diff options
author | Guido van Rossum <guido@python.org> | 2016-01-06 19:03:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-01-06 19:03:15 (GMT) |
commit | 1a4afec0d66d8843834250836d1056ed6d687385 (patch) | |
tree | e7579960c7afc7bffdd08d1fc4f552a47d72fd1b /Lib/pathlib.py | |
parent | 520f297eb4d85a99bee8a22d60c4139b8a443d94 (diff) | |
parent | e42823153990ab5a4bb5f9148458cf48e189f4f9 (diff) | |
download | cpython-1a4afec0d66d8843834250836d1056ed6d687385.zip cpython-1a4afec0d66d8843834250836d1056ed6d687385.tar.gz cpython-1a4afec0d66d8843834250836d1056ed6d687385.tar.bz2 |
Issue #22570: Add 'path' attribute to pathlib.Path objects. (Merge 3.4->3.5)
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index d03aede..a1e0a82 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -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.""" |