Re: Model instance identity

2007-02-15 Thread Ned Batchelder
I think in this case the Python docs were mis-interpreted. The key point to consider when writing a __hash__ function is that two objects that compare equal must hash equally, and the hash value cannot change. Just because an object is mutable doesn't mean that these rules will be violated. In

Re: Model instance identity

2007-02-14 Thread Ivan Sagalaev
David Abrahams wrote: > I just wrote some code that used Model instances as keys in a dict, > and was surprised to find two instances in the dict that represented > the same object in the database. Shouldn't that be impossible? If > you can't guarantee that a given object in the database is alwa

Model instance identity

2007-02-13 Thread David Abrahams
I just wrote some code that used Model instances as keys in a dict, and was surprised to find two instances in the dict that represented the same object in the database. Shouldn't that be impossible? If you can't guarantee that a given object in the database is always represented by the same Py