[Python-ideas] Updated PEP 428 (pathlib)

Oleg Broytman phd at phdru.name
Sun Mar 3 10:14:36 CET 2013


Hi!

On Sun, Mar 03, 2013 at 09:46:16AM +0100, Charles-Fran?ois Natali <cf.natali at gmail.com> wrote:
> >>> p = PureNTPath('c:/Downloads/pathlib.tar.gz')
> >>> p.name
> 'pathlib.tar.gz'
> >>> p.basename
> 'pathlib.tar'
> >>> p.suffix
> '.gz'
> 
> I find the 'p.basename' name confusing: following POSIX conventions,
> 'basename' should be 'pathlib.tar.gz'.

   Yes, and ntpath.py/posixpath.py follow this terminology.

> I don't have another 'name' to
> propose for the stripped name, though.

   ntpath.py/posixpath.py name these parts "root" and "extension".
"Root", of course, has its own share of different connotations.

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list