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/104505.html below:

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

Idiom gone, or did it really ever exist? () is ()Alex Martelli aleaxit at yahoo.com
Wed Apr 18 07:00:43 EDT 2001
"Mike C. Fletcher" <mcfletch at home.com> wrote in message
news:mailman.987583046.24994.python-list at python.org...
> Hmm, checking my code, you are right, the idiom I was actually using (in
one
> very old module still in my codebase, and which still works ;) ) was
> (paraphrased):
>
>     NULL = (1,) # why doesn't () work? Get with it Guido ;)

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.


Alex




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