<var> is None vs. <var> == None

Roger rdcollum at gmail.com
Fri Jan 23 21:48:29 CET 2009


> And, just for completeness, the "is" test is canonical precisely because
> the interpreter guarantees there is only ever one object of type None,
> so an identity test is always appropriate. Even the copy module doesn't
> create copies ...
>

Does the interpreter guarantee the same for False and True bools?



More information about the Python-list mailing list