Skip to content

Commit d1b23c8

Browse files
committed
Document __bytes__ in PurePath docstring
1 parent ace5824 commit d1b23c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/pathlib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,11 @@ class PurePath(_BasePurePath):
674674
instantiating a PurePath will return either a PurePosixPath or a
675675
PureWindowsPath object. You can also instantiate either of these classes
676676
directly, regardless of your system.
677+
678+
On Posix, calling ``bytes()`` on a path gives the raw filesystem path as
679+
a bytes object, as encoded by ``os.fsencode()``. On Windows, the unicode
680+
form is the canonical representation of fileysstem paths, and so calling
681+
``bytes()`` on a path is not recommended.
677682
"""
678683
__slots__ = ()
679684

0 commit comments

Comments
 (0)