Issue #22570: Add 'path' attribute to pathlib.Path objects. (Merge 3.4->3.5)

This commit is contained in:
Guido van Rossum 2016-01-06 11:03:15 -08:00
commit 1a4afec0d6
3 changed files with 40 additions and 0 deletions

View file

@ -690,6 +690,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."""