Jim Fulton wrote: > > Gordon McMillan 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. > I'll leave the final determination to Mr. Python, but I disagree. Offhand I can't think of a built-in that can't be expressed in normal Python notation, where "optional" args are really defaulted args. Which would lead us to either a new list method, or redefining pop: def pop(usedefault=0, default=None) and making you use 2 args. But maybe I've missed a precedent because I'm so used to it. (Hmm, I guess string.split is a sort-of precedent, because the first default arg behaves differently than anything you could pass in). - Gordon
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