The 'is' identity operator checking immutable values caution

castironpi at gmail.com castironpi at gmail.com
Tue May 13 06:59:56 EDT 2008


On May 13, 5:37 am, Christian Heimes <li... at cheimes.de> wrote:
> wxPytho... at gmail.com schrieb:
>
> > 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.
>
> You are confusing immutable objects with singletons. Never use "is" with
> strings and numbers.
>
> Christian

I was back on 'handle'.  Handle internally, handle right.  Gotta be 6
a.m.



More information about the Python-list mailing list