Explanation of list reference

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Feb 17 06:52:21 CET 2014


On Sun, 16 Feb 2014 20:01:46 +0200, Marko Rauhamaa wrote:

> As far as "x is None" is concerned, a key piece of information is
> presented on <URL: http://docs.python.org/3.2/library/constants.html>:
> 
>   None
>     The sole value of the type NoneType.
          ^^^^

Sole, adj. "being the only one; single and isolated from others", e.g. 
"the sole heir", "the sole example".

In plain English, None is the sole (only, single) instance of its type. 
In computer science jargon, None is a singleton.


> Thus, there might still be a nagging concern that a second NoneType
> object x such that
> 
>    x == None and x is not None
> 
> could crop up (from native code, perhaps).

If that were possible, then None would not be the sole instance of its 
type. Since None is documented as being a singleton, that would be a bad 
bug.



-- 
Steven



More information about the Python-list mailing list