[Python-ideas] Better stdlib support for Path objects

Petr Viktorin encukou at gmail.com
Tue Oct 7 20:46:00 CEST 2014


On Tue, Oct 7, 2014 at 8:25 PM, Wes Turner <wes.turner at gmail.com> wrote:
> Does path.py have different performance in this respect?
>
> I like the Path.isdir(), Path.walk() methods; but maybe not for everyone.
>
> Way OT, but similar support for URIs (e.g. URLObject) would likely need to
> take a similar approach:
> http://www.reddit.com/r/Python/comments/1r7h1t/python_objects_for_working_with_urls_and_uris/

URLObject is actually a good reason against __strpath__: path.open()
should work whether path is a filesystem path, or a URL object (with
pathlib API), or any other path-like object; while open(path) would
not.
I think path.open() should be encouraged.


More information about the Python-ideas mailing list