Attribute path not in PurePosixPath ?
Vincent Vande Vyvre
vincent.vande.vyvre at telenet.be
Sun Jan 24 04:00:24 EST 2016
Le 24/01/2016 08:58, Vincent Vande Vyvre a écrit :
> 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 ?
OOps, is new in 3.4.5
Sorry for the noise.
Vincent
More information about the Python-list
mailing list