[Python-ideas] PEP 428 - object-oriented filesystem paths

Calvin Spealman ironfroggy at gmail.com
Sun Oct 14 15:09:10 CEST 2012


On Sun, Oct 14, 2012 at 8:45 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On 14/10/12 23:13, Antoine Pitrou wrote:
>>
>> Le dimanche 14 octobre 2012 à 14:04 +0200, Yuval Greenfield a écrit :
>>>
>>>
>>> Steven realized what currently happens and was suggesting doing it
>>> differently.
>>>
>>>
>>> Personally I really dislike the idea that
>>>
>>>
>>>      [i for i in p][0] != p[0]
>>>
>>>
>>> It makes no sense to have this huge surprise.
>>
>>
>> Again, p[0] just raises TypeError.
>
>
>
> Well, that's two people so far who have conflated "p.parts" as just p.
> Perhaps that's because "parts" is so similar to "path".
>
> Since we already refer to the bits of a path as "path components",
> perhaps this bike shed ought to be spelled "p.components". It's longer,
> but I bet nobody will miss it.

I would prefer to see p.split()

It matches the existing os.path.split() better and I like the idea of
a new library matching the old, to be an easier transition for brains.

That said, it also looks too much like str.split()

> --
> Steven
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



-- 
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://techblog.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy



More information about the Python-ideas mailing list