[Zope] The Honest Scoop on Zope

Michel Pelletier michel@digicool.com
Thu, 9 Sep 1999 11:11:10 -0400


> -----Original Message-----
> From: John Goerzen [mailto:jgoerzen@complete.org]
> Sent: Thursday, September 09, 1999 10:42 AM
> To: Terrel Shumway
> Cc: zope@zope.org
> Subject: Re: [Zope] The Honest Scoop on Zope
> 
> 
> Terrel Shumway <tshumway@epicor.com> writes:
> 
> > The Python tutorial may help with things like embedding 
> quotes and "casting"
> > 
> > (Python is dynamically typed: casting is a foreign concept).
> >  http://www.python.org/doc
> 
> OK, but not quite so in Zope.  For instance, when I want to compare a
> date to, say, January 1, 1980, I can't just use <=.  I must first use
> the (undocumented) _.DateTime to convert '1980/01/01' to a Date
> object.  THEN I can use <=.

This is the same in Python.  Python does not 'type' objects but objects
still have a type.  You are expected to understand at each stage in the
life of an object what type it is.

> Incidentally, how can I overload <= to work with my own objects?

Your object must define an __cmp__ method:

http://www.python.org/doc/current/ref/customization.html#l2h-130

-Michel

> 
> -- John
> 
> -- 
> John Goerzen   Linux, Unix consulting & programming   
> jgoerzen@complete.org |
> Developer, Debian GNU/Linux (Free powerful OS upgrade)       
> www.debian.org |
> --------------------------------------------------------------
> --------------+
> The 139,134,919th prime number is 2,884,111,709.
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
>