[Zope] The Honest Scoop on Zope

Martijn Pieters mj@antraciet.nl
Thu, 09 Sep 1999 17:07:45 +0200


At 16:41 09/09/99 , John Goerzen wrote:
>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 <=.
>
>Incidentally, how can I overload <= to work with my own objects?

Use a __cmp__ method. See the Python Language Reference.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------