Issue #22570: Add 'path' attribute to pathlib.Path objects.

This commit is contained in:
Guido van Rossum 2016-01-06 11:01:42 -08:00
parent 69bfb15bd8
commit e428231539
3 changed files with 40 additions and 0 deletions

View file

@ -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."""