21 Apr
2003
21 Apr
'03
10:26 p.m.
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