[ZODB-Dev] Issue trying to remove elements in OOTreeSet

César Muñoz xcumail at gmail.com
Fri Sep 24 04:17:42 EDT 2010


Hello Marius,

thank you so much for your quick answer! I'll give it a try implementing
these methods and will get back to you with the result.
But anyway, the Chatroom class is inheriting from Persistent, I thought this
base class provided some basic comparison methods...

2010/9/23 Marius Gedminas <marius at gedmin.as>

>
> It sounds as if your Chatroom class doesn't implement comparison
> operators (__lt__ and friends) correctly.
>
> If you want to store objects in an OOTreeSet, those objects must
> have a well-defined ordering that doesn't change when the objects are
> loaded back from the ZODB and end up at a different memory address.  The
> default comparison provided by Python doesn't cut it.
>
> So: does your Chatroom define __cmp__ or __lt__, __le__, __gt__, __ge__,
> __eq__, __ne__ methods?
>
> Marius Gedminas
> --
> Writing setattr hooks properly is a black art. Writing persistent
> setattr hooks is more like hearding bees blindfolded...
>        -- Casey Duncan
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkybjnEACgkQkVdEXeem148NFQCfS2OOWnFqE+T84UPy9gmR4Pj1
> VmoAmwXK5YQWO5Arku2Q3NMRyyBFygUg
> =vuUn
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> https://mail.zope.org/mailman/listinfo/zodb-dev
>
>


-- 
César Muñoz

CERN
IT-UDS-AVC-Indico
Bd. 513, R-042
Tel.: +41 22 76 77159
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zodb-dev/attachments/20100924/e521f3d7/attachment.html 


More information about the ZODB-Dev mailing list