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/
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