[ZODB-Dev] __cmp__() for PersistentMapping?

Greg Ward gward@mems-exchange.org
Thu, 16 Aug 2001 11:35:53 -0400


Why does PersistentMapping not have a __cmp__() method?  Seems like a
no-brainer to me.  In fact, here's a simplistic patch against the
current CVS (cvs.zope.org:/cvs-repository/StandaloneZODB/ZODB -- hope I
got it right):

--- PersistentMapping.py        5 Jun 2001 18:49:58 -0000       1.10
+++ PersistentMapping.py        16 Aug 2001 15:32:52 -0000
@@ -106,2 +106,5 @@
 
+    def __cmp__(self,other):
+        return cmp(self._container, other._container)
+
     def __delitem__(self, key):

Of course, this assumes that other is also a PersistentMapping.  Hmmm.

Any interest in this?  I could just check it in to Andrew's SourceForge
ZEO project, but that seems kind of antisocial...

        Greg