[Zope-dev] __cmp__ in python classes?

Jim Fulton jim@digicool.com
Thu, 16 Dec 1999 20:42:36 +0000


Benno Rice wrote:
> 
> On Tue, Dec 14, 1999 at 01:52:22PM +0000, Jim Fulton wrote:
> > >
> > >     I thought this looked familliar.  Unfortuantely, I don't have that
> > > patch anymore.  I squeezed some old brain cells REALLY hard, and I think I
> > > recall trick.  It's only a few lines, let's see if I can recreate it
> > > today.
> >
> > Let me search my old mail first.
> >
> > >     BTW, AFAIK I don't have the ability to commit to the CVS tree.
> >
> > Hm. OK, assuming I find your mail, I'll check it in. This probably
> > won't happen till tomorrow.
> 
> Were you able to find the patch?

No.

I just checked in a more ambitious patch that:

  - Implements the numeric protocol. This means that
    wrapped numeric objects should work.

  - Fixed comparison betwee wrapped and unwrapped
    objects.

  - Pass wrapped objects to comparison operators, 
    so that acquired data can be used in comparisons. :)

I also fixed a bug in some numeric coersion code in 
ExtensionClass.

So two C files were updated, ExtensionClass.c and
Acquisition.c.  You'll need to rebuild the corresponding
extensions (by running make in lib/python) after checking 
these out.

Jim
    


--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.