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

Yuval Greenfield ubershmekel at gmail.com
Sun Oct 14 14:04:52 CEST 2012


On Sun, Oct 14, 2012 at 1:03 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Sun, 14 Oct 2012 21:48:59 +1100
> Steven D'Aprano <steve at pearwood.info> wrote:> -1 on iteration over the
> children. Instead, use:
> >
> > for child in p.walk():
> >      ...
> >
> > which has the huge benefit that the walk method can take arguments as
> > needed, such as the args os.walk takes:
> >
> > topdown=True, onerror=None, followlinks=False
>
> Judging by its name and signature, walk() would be a recursive
> operation, while iterating on a path isn't (it only gets you the
> children).
>
>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121014/e7ab672c/attachment.html>


More information about the Python-ideas mailing list