At Tuesday 14/11/2006 19:27, [EMAIL PROTECTED] wrote:

> >Can you point me to a description of this algorithm?  It doesn't seem
> >to be described in the documentation for the rich comparison or __cmp__
> >methods...
>
> PEP 207
> http://www.python.org/dev/peps/pep-0207/

So since I implemented __cmp__ instead of the rich comparison
operators, Python first tried to reverse the comparison.  This gave
datetime the opportunity to throw TypeError *before* the interpreter
failed over to trying __cmp__.

Is that correct?

Exactly. And if datetime were not so special in its implementation, a NotImplementedError (instead of TypeError) would have let your code a chance of being executed.


--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to