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?
> 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?
Ooo. Timing. Good one. <joins rip on 3.0>
Writer's other wanderings bring Microsoft Research. Who talks to that on a daily basis?
> 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.
> > 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.
> 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.