Jim Fulton wrote:
Violating Pythonic expectations by, in effect, creating 2 methods list.pop(void) list.pop(default_return)
Yes, except that I disagree that this is non-pythonic.
Wouldn't a generic builtin for these kinds of things be better, e.g. a function returning a default value in case an exception occurs... something like: tryexcept(list.pop(), IndexError, default) which returns default in case an IndexError occurs. Don't think this would be much faster that the explicit try:...except: though... -- Marc-Andre Lemburg ______________________________________________________________________ Y2000: 162 days left Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/