A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-April/034829.html below:

os.path.walk() lacks 'depth first' option

[Python-Dev] Re: os.path.walk() lacks 'depth first' option [Python-Dev] Re: os.path.walk() lacks 'depth first' optionFrançois Pinard pinard@iro.umontreal.ca
20 Apr 2003 22:14:02 -0400
[Guido van Rossum]

> But if I had to do it over again, I wouldn't have added walk() in the
> current form.  I often find it harder to fit a particular program's
> needs in the API offered by walk() than it is to reimplement the walk
> myself.

I do not much use `os.path.walk' myself.  It is so simple to write a small
walking loop with a stack of unseen directories, and in practice, there is
a wide range of ways and reasons to walk a directory hierarchy, some of
which do not fit nicely in the current `os.path.walk' specifications.

> That's why I'm concerned about adding to it.

The addition of generators to Python also changed the picture somewhat, in
this area.  It is often convenient to use a generator for a particular walk.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4