Skip to content

Commit f890f8f

Browse files
authored
Path refactor (#2959)
1 parent 379d99b commit f890f8f

File tree

9 files changed

+223
-465
lines changed

9 files changed

+223
-465
lines changed

docs/source/reference-io.rst

+5
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,11 @@ Asynchronous path objects
631631

632632
.. autoclass:: Path
633633
:members:
634+
:inherited-members:
635+
636+
.. autoclass:: PosixPath
637+
638+
.. autoclass:: WindowsPath
634639

635640

636641
.. _async-file-objects:

newsfragments/2959.feature.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:class:`Path` is now a subclass of :class:`pathlib.PurePath`, allowing it to interoperate with other standard
2+
:mod:`pathlib` types.
3+
4+
Instantiating :class:`Path` now returns a concrete platform-specific subclass, one of :class:`PosixPath` or
5+
:class:`WindowsPath`, matching the behavior of :class:`pathlib.Path`.

src/trio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
open_ssl_over_tcp_stream as open_ssl_over_tcp_stream,
7474
serve_ssl_over_tcp as serve_ssl_over_tcp,
7575
)
76-
from ._path import Path as Path
76+
from ._path import Path as Path, PosixPath as PosixPath, WindowsPath as WindowsPath
7777
from ._signals import open_signal_receiver as open_signal_receiver
7878
from ._ssl import (
7979
NeedHandshakeError as NeedHandshakeError,

0 commit comments

Comments
 (0)