[Python-ideas] Updated PEP 428 (pathlib)

Jan Kaliszewski zuo at chopin.edu.pl
Tue Mar 5 00:33:48 CET 2013


Hello,

1. Ad:
     >>> PurePosixPath('/usr/bin/python').relative('/etc')
     Traceback (most recent call last):
       ...
     ValueError: ...

Shouldn't this particular operation return 
"PurePosixPath('/etc/../usr/bin/python')"?

2. 03.03.2013 15:12, Charles-François Natali wrote:

>> Yes. We could call it
>> "root" (http://en.wikipedia.org/wiki/Root_%28linguistics%29) but in
>> this context it would be confusing. Also, it's not exactly the root
>> since as you point there can still be a remaining suffix.
>
> Indeed, "root" would be even more confusing.
>
>> There's "stem", too (http://en.wikipedia.org/wiki/Word_stem). With 
>> the
>> same provision about not being the actual stem.
>
> Also, it doesn't sound familiar (at least to me).
>
> How about "rootname", or "stripped_name" (the last one is a little 
> too long)?

Maybe simply "stripped"? Or "stemname"? Or "unsuffixed"?...

Anyway "basename" is IMHO a bad idea because in os.path it is already 
used for something completely different.

Cheers.
*j




More information about the Python-ideas mailing list