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 <=. Incidentally, how can I overload <= to work with my own objects? -- 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.
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 ------------------------------------------
participants (2)
-
John Goerzen -
Martijn Pieters