The 'is' identity operator checking immutable values caution

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Tue May 13 11:59:01 EDT 2008


wxPythoner at gmail.com a écrit :
> We have to avoid the use of the 'is' identity operator with basic,
> immutable values such as numbers and strings. The result is
> unpredictable because of the way Python handles these objects
> internally.
> 
> How is with this issue in Python 3.0? Is it fixed? Does Python handle
> this things properly now?

This is not an issue and is already properly handled. Don't use identity 
test when you want an equality test, period.



More information about the Python-list mailing list