mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #22570: Add 'path' attribute to pathlib.Path objects. (Merge 3.4->3.5)
This commit is contained in:
commit
1a4afec0d6
3 changed files with 40 additions and 0 deletions
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue