[ZODB-Dev] __cmp__() for PersistentMapping?

JohnD.Heintz JohnD.Heintz
Thu, 16 Aug 2001 15:18:43 -0500


This code breaks with:
PersistenMapping() =3D=3D None
is called.

John

On Thursday 16 August 2001 12:30, Jim Fulton wrote:
> Greg Ward wrote:
> > 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=
=2E
>
> Hm indeed, but this is an improvement.
>
> > Any interest in this?
>
> Sure.
>
> > I could just check it in to Andrew's SourceForge
> > ZEO project, but that seems kind of antisocial...
>
> Yes. I just checked this in.
>
> Jim
>
> --
> Jim Fulton           mailto:jim@zope.com       Python Powered!
> Technical Director   (888) 344-4332            http://www.python.org
> Zope Corporation     http://www.zope.com       http://www.zope.org
>
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zodb-dev

--=20
=2E . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com

w w w . d a t a c h a n n e l . c o m