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

Yuval Greenfield ubershmekel at gmail.com
Fri Oct 5 21:36:56 CEST 2012


On Fri, Oct 5, 2012 at 9:16 PM, Oleg Broytman <phd at phdru.name> wrote:

>    Some attributes are properties and some are methods. Which is which?
> Why .root is a property but .parents() is a method? .owner/.group are
> properties but .exists() is a method, and so on. .stat() just returns
> self._stat, but said ._stat is a property!
>
>
Unobvious indeed. Maybe operations that cause OS api calls should have
parens?

Also, I agree with Paul Moore that the naming at its current state may
cause cross-platform bugs.

Though I don't understand why not to overload the "/" or "+" operators.
Sounds more elegant than square brackets. Just make sure the op fails on
anything other than Path objects.

I'm +1 on adding such a useful abstraction to python if and only if it were
>= os.path on every front,

Yuval Greenfield
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121005/f98bfa31/attachment.html>


More information about the Python-ideas mailing list