[ZODB-Dev] Object uniqueness

Tres Seaver tseaver at palladion.com
Fri Oct 3 12:23:23 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Markus Läll wrote:
> I think I know now -- objects compare identical and equal only if they are
> in the same container object. (Check the code below)
> 
> I don't mean to be negative, but why can't ZODB be like a big RAM? Like
> when i store an object to multiple places on the same DB, then it would
> actually be the same in each place. (Like if you comment out the "Commit,
> close and reload" part of the below code, all the comparisons evaluate to
> True)

If your classes derive from persistence.Persistent, then their
instances' identities will be preserved across serializations.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI5kb7+gerLs4ltQ4RAq3yAJ9USY6EX+cssrxT0ZOOlS6EG+OREwCfYn5g
MqQBgyaT2JnWYe18jJSI/pE=
=Z0o3
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list