[issue2789] Comparsion datetime objects with None

Terry J. Reedy report at bugs.python.org
Sat May 10 05:03:26 CEST 2008


Terry J. Reedy <tjreedy at udel.edu> added the comment:

You actually have it backwards ;-)  The arbitrary responses to
nonsensical cross-class order comparisons found in 1.x and 2.x are now
considered a design bug.  They are disappearing in 3.0.

Datetime is a fairly recent module (new in 2.3) written to the new
standard.  The number 1, for instance, in the same comparisons, raises
the same exceptions.  And the manual specifies this.  For instance, the
time class section on comparison explicitly says: "In order to stop
mixed-type comparisons from falling back to the default comparison by
object address, when a time object is compared to an object of a
different type, TypeError is raised unless the comparison is == or !=."

Closing as invalid.

As indicated in the quote, equality comparisons are different from order
comparisons.  None really is not equal to anything else.  This is still
true in 3.0.

----------
nosy: +tjreedy
resolution:  -> invalid
status: open -> closed

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2789>
__________________________________


More information about the Python-bugs-list mailing list