Tuple assignment and generators?

vdrab stijndesaeger at gmail.com
Fri May 5 05:01:02 EDT 2006


> No.  Why should you ever care about whether two integers representing
> values are the same object?  Your tests should be with `==`, not `is`.

Given this though, what other such beauties are lurking in the
interpreter, under the name of 'implementation accidents'? One of the
things that drew me to python is the claimed consistency and
orthogonality of both language and implementation, not sacrificing
clarity for performance, minimizing ad-hoc design hacks and weird
gotcha's, etc...
In fact, I think my code contains things like "if len(arg) is 0:" and
so on, and I feel I should be able to do so given the way python treats
(claims to treat?) constant objects, even if I don't care whether the
values actually represent the same object.
s.




More information about the Python-list mailing list