Attribute path not in PurePosixPath ?
Vincent Vande Vyvre
vincent.vande.vyvre at telenet.be
Sun Jan 24 02:58:14 EST 2016
Hi,
Refering to the doc
https://docs.python.org/3/library/pathlib.html?highlight=pathlib#pathlib.PurePath.path
----------------------------------------------------------------------------
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import PurePath
>>> p = PurePath('/home/vincent/Images')
>>> p.name
'Images'
>>> p.suffix
''
>>> p.parent
PurePosixPath('/home/vincent')
>>> [parent for parent in p.parents]
[PurePosixPath('/home/vincent'), PurePosixPath('/home'), PurePosixPath('/')]
>>> p.path
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'PurePosixPath' object has no attribute 'path'
----------------------------------------------------------------------------
Am I misunderstood the doc ?
More information about the Python-list
mailing list