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/034856.html below:

[Python-Dev] os.path.walk() lacks 'depth first' option

[Python-Dev] os.path.walk() lacks 'depth first' option [Python-Dev] os.path.walk() lacks 'depth first' optionJeremy Fincher fincher.8@osu.edu
Mon, 21 Apr 2003 12:56:42 -0400
On Sunday 20 April 2003 10:12 pm, Tim Peters wrote:
>     if 'CVS' in dirs:
>         dirs.remove('CVS')

This code brought up an interesting question to me: if sets have a .discard 
method that removes an element without raising KeyError if the element isn't 
in the set, should lists perhaps have that same method?

On another related front, sets (in my Python 2.3a2) raise KeyError on a 
.remove(elt) when elt isn't in the set.  Since sets aren't mappings, should 
that be a ValueError (like list raises) instead?

Jeremy



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