Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Vincent Vande Vyvre Newsgroups: comp.lang.python Subject: Re: Attribute path not in PurePosixPath ? Date: Sun, 24 Jan 2016 10:00:24 +0100 Lines: 37 Message-ID: References: <56a475a2$0$1524$c3e8da3$5496439d@news.astraweb.com> <56A48416.5010003@telenet.be> Reply-To: vincent.vandevyvre@oqapy.eu Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de zgj1gRg+ZUzaTTf88oOVDwl6xlnpkHrTwXUyK0CH56hA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'skip:[ 30': 0.09; 'python': 0.10; 'subject:not': 0.11; 'from:name:vincent vande vyvre': 0.16; 'received:195.130': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:telenet-ops.be': 0.16; '\xe9crit': 0.16; 'attribute': 0.18; '>>>': 0.20; '"",': 0.22; 'doc': 0.22; 'import': 0.24; '(most': 0.24; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'linux': 0.26; 'subject: ?': 0.27; "skip:' 10": 0.28; 'received:be': 0.30; 'url:python': 0.33; 'traceback': 0.33; 'file': 0.34; 'skip:p 30': 0.35; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'skip:p 20': 0.38; 'hi,': 0.38; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'charset:windows-1252': 0.62; 'more': 0.63; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'url:path': 0.84 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <56A48416.5010003@telenet.be> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102075 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 "", line 1, in > AttributeError: 'PurePosixPath' object has no attribute 'path' > ---------------------------------------------------------------------------- > > > Am I misunderstood the doc ? OOps, is new in 3.4.5 Sorry for the noise. Vincent