On Thu, Mar 3, 2016 at 12:39 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Chris Angelico <ros...@gmail.com>: > >> Python defines that every object has an identity, which can be >> represented as an integer. Since this is an intrinsic part of the >> object, no two distinct objects can truly have identical >> characteristics. Python's objects are like rifles - there are many >> like it, but this one is mine. > > How can you be sure Python isn't returning the same id value for two > distinct objects?
The same way I can be sure about anything else in Python. It's a language guarantee. If you're bothered by that, you should also be concerned that str(x) might not actually call x.__str__(), or that a+b*c might evaluate the addition before the multiplication. ChrisA -- https://mail.python.org/mailman/listinfo/python-list