[Python-Dev] Issue 2736: datetimes and Unix timestamps (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jun 6 01:16:33 CEST 2012


Terry Reedy wrote:

"A rich comparison method may return the singleton NotImplemented if it does not implement the operation for a given pair of arguments. By convention, False and True are returned for a successful comparison. However, these methods can return any value,"

That's to give the other operand a chance to handle the operation. If they both return NotImplemented, then a TypeError is raised by the interpreter.

-- Greg



More information about the Python-Dev mailing list