pep 336: Make None Callable

Terry Reedy tjreedy at udel.edu
Wed Nov 3 23:23:15 EST 2004


"The Eternal Squire" <eternalsquire at comcast.net> wrote in message 
news:dv6dndASE7CxNBTcRVn-pw at comcast.com...
> PEP: 336
> Abstract
>
>     None should be a callable object that when called with any
>     arguments has no side effect and returns None.

Please no.  The None object, by definition, is an object with no value, no 
behavior (except compares), and no specific attributes (other than those 
common to all descendents of object).  That one can currently compare None 
to other objects can be considered a bug, and this might go away in the 
future.

Anyone who wants a null function can write it in about 20 keypresses, and 
include it in a utility module if one has one.

It would be more sensible to promote the addition to builtins of a 
predefined null function -- one somewhat equivalent to 0, [], and {}.

Terry J. Reedy








More information about the Python-list mailing list