[Python-Dev] Got None. Maybe Some? (original) (raw)

Josiah Carlson jcarlson at uci.edu
Mon Dec 22 14:45:19 EST 2003


> Is None so weird? All I am proposing is a symmetric value to None. > Just like there is a -1 and 1, -Infinity and Infinity, None logically > should have Some. Maybe not so much -Some == None, but as I propose in > the PEP, possibly Some == not None.

None's purposr is not to be less than all numbers (in fact in the past it wasn't); it's to be "not any object", like nil or NULL in other languages. I don't see a similar broad role for Some. And I repeat my question: which other language has that concept? --Guido van Rossum (home page: http://www.python.org/~guido/)

Certainly if one thinks of None as an object, or a possible pointer to an object, None does fit the role of nil or NULL. The fact is, NULL and nil, as pointers, are 0. None does not equal 0, it is a symbolic representation of the lack of any value (something I remember you saying before, but cannot find a quote), who'se original purpose was to be an equivalent to nil or NULL. As of right now, None has gone beyone its original purpose. As soon as comparisons were able to be done to it and reveal that None was smaller than anything else (even the floating point -infinity), it seemingly has become a more consistant minimum value.

Some is just begging to be a more consistant maximum value. It is bigger than sys.maxint, float(1e309), and reveals that the current state is special.

What other language has the concept? Python already has the concept. None is currently used as negative infinity in some projects, an actual negative infinity, one that doesn't crap out on integers that cannot be cast into floats. Some would become positive infinity.

In terms of non-Python languages, I don't know of any, but that doesn't mean that they don't exist - it just means that I have limited knowledge of programming languages (I only know about 7 or so).



More information about the Python-Dev mailing list