A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/080674.html below:

Idiom gone, or did it really ever exist? () is ()

Idiom gone, or did it really ever exist? () is ()Mike C. Fletcher mcfletch at home.com
Wed Apr 18 11:37:57 EDT 2001
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.
...



More information about the Python-list mailing list

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