diff options
author | Brett Cannon <brett@python.org> | 2016-06-09 22:58:06 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-06-09 22:58:06 (GMT) |
commit | b08388d5f2e62577e1a2379deb1681af4f148811 (patch) | |
tree | 5b8fc3c930880fec49527169c911b1a61507dd50 /Doc/library/os.rst | |
parent | 516f5461b0959ae72d4cf57605422ec78f008220 (diff) | |
download | cpython-b08388d5f2e62577e1a2379deb1681af4f148811.zip cpython-b08388d5f2e62577e1a2379deb1681af4f148811.tar.gz cpython-b08388d5f2e62577e1a2379deb1681af4f148811.tar.bz2 |
Issue #27182: Document os.PathLike.
Part of PEP 519.
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r-- | Doc/library/os.rst | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 3dca86e..4070bf5 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -175,6 +175,9 @@ process and user. .. versionadded:: 3.2 + .. versionchanged:: 3.6 + Support added to accept objects implementing :class:`os.PathLike`. + .. function:: fsdecode(filename) @@ -185,6 +188,9 @@ process and user. .. versionadded:: 3.2 + .. versionchanged:: 3.6 + Support added to accept objects implementing :class:`os.PathLike`. + .. function:: fspath(path) @@ -195,6 +201,21 @@ process and user. (which is represented by :class:`os.PathLike`). All other types raise a :exc:`TypeError`. + .. versionadded:: 3.6 + + +.. class:: PathLike + + An :term:`abstract base class` for objects representing a file system path, + e.g. :class:`pathlib.PurePath`. + + .. abstractmethod:: __fspath__() + + Return the file system path representation of the object. + + The method should only return a :class:`str` or :class:`bytes` object, + with the preference being for :class:`str`. + .. function:: getenv(key, default=None) |