Gregory Ewing <greg.ew...@canterbury.ac.nz>: > There is more leeway when it comes to immutable objects; > implementations are free to cache and re-use them, so well-written > code avoids depending on the result of "is" for immutable objects.
I definitely trust that: a = b assert a is b even when b holds an immutable object. Assignment, argument passing, return value passing and yield (to name a few) must preserve identity. Marko -- https://mail.python.org/mailman/listinfo/python-list