mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #22570: Add 'path' attribute to pathlib.Path objects.
This commit is contained in:
parent
69bfb15bd8
commit
e428231539
3 changed files with 40 additions and 0 deletions
|
@ -645,6 +645,13 @@ class PurePath(object):
|
|||
self._parts) or '.'
|
||||
return self._str
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
try:
|
||||
return self._str
|
||||
except AttributeError:
|
||||
return str(self)
|
||||
|
||||
def as_posix(self):
|
||||
"""Return the string representation of the path with forward (/)
|
||||
slashes."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue