id(a) == id(b) and a is not b --> bug?

Steve McAllister nosp at m.needed
Fri Jun 6 15:35:20 CEST 2003

> If any kind of computation is performed in the arguments, the property
> you assume may not hold.

And exactly why is {
'foo' is 'foo' is 'foo' is 'foo'
} always true?  This is quite surprising compared to {
[] is []
} ...
Why are not new string literals dynamically created?

More information about the Python-list mailing list