Yup, I mentioned that in the original article ;) (same with the *args, **namedargs approaches). I actually switched to using this: class NULLARGUMENT: pass Then I use the class as the default value for is-checking. Which I'm told is evil :) . Mike -----Original Message----- From: Alex Martelli [mailto:aleaxit at yahoo.com] Sent: Wednesday, April 18, 2001 07:01 To: python-list at python.org Subject: Re: Idiom gone, or did it really ever exist? () is () ... Why not _NULL = [] and then def x(y=_NULL): if y is _NULL: print "no argument" i.e., your original trick, but with a _mutable_ object. This way it should keep working forever, I believe. ...
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