A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-April/034980.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' optionMichael Chermside mcherm@mcherm.com
Thu, 24 Apr 2003 09:44:09 -0700
Tim:

Don't get a swelled head or anything ;-), but your generator-based version 
of walk() is beautiful piece of work. I don't mean the code (although that's
clean and readable), but the design. Using a generator is clearly good,
having it return (path,names) tuples is a nice way to work, and having
it return (path,dirnames,filenames) tuples is inspired. (If you want
them lumped together, just add the lists!) Allowing the consumer to 
modify control the flow by modifying dirnames is very nice. And the fact
that it's so simple to code (22 short lines) is a testament to the power 
of generators.

I'm +2 on putting this in immediately and deprecating os.path.walk().

-- Michael Chermside




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