Skip to content

Commit

Permalink
Path refactor (#2959)
Browse files Browse the repository at this point in the history
  • Loading branch information
etianen authored Mar 11, 2024
1 parent 379d99b commit f890f8f
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 465 deletions.
5 changes: 5 additions & 0 deletions docs/source/reference-io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ Asynchronous path objects

.. autoclass:: Path
:members:
:inherited-members:

.. autoclass:: PosixPath

.. autoclass:: WindowsPath


.. _async-file-objects:
Expand Down
5 changes: 5 additions & 0 deletions newsfragments/2959.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:class:`Path` is now a subclass of :class:`pathlib.PurePath`, allowing it to interoperate with other standard
:mod:`pathlib` types.

Instantiating :class:`Path` now returns a concrete platform-specific subclass, one of :class:`PosixPath` or
:class:`WindowsPath`, matching the behavior of :class:`pathlib.Path`.
2 changes: 1 addition & 1 deletion src/trio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
open_ssl_over_tcp_stream as open_ssl_over_tcp_stream,
serve_ssl_over_tcp as serve_ssl_over_tcp,
)
from ._path import Path as Path
from ._path import Path as Path, PosixPath as PosixPath, WindowsPath as WindowsPath
from ._signals import open_signal_receiver as open_signal_receiver
from ._ssl import (
NeedHandshakeError as NeedHandshakeError,
Expand Down
Loading

0 comments on commit f890f8f

Please sign in to comment.