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

Neil Schemenauer nas at python.ca
Wed Apr 18 19:13:56 EDT 2001


Mike C. Fletcher wrote:
>     NULL = (1,) # why doesn't () work? Get with it Guido ;)

That is another immutable object.  CPython doesn't cache those
objects yet but its better to use:

    NULL = []

instead.  Or:

    class NULL:
        pass

if you think that's more clear.

  Neil




More information about the Python-list mailing list