diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-02-07 22:50:28 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-02-07 22:50:28 (GMT) |
commit | 07534a607bd3d2fd232323811a83279acda10885 (patch) | |
tree | 129fc63de44a72f412e64c591746530324261500 /Include/ucnhash.h | |
parent | 275666fd50eaf494448ba102652d4273b135a017 (diff) | |
download | cpython-07534a607bd3d2fd232323811a83279acda10885.zip cpython-07534a607bd3d2fd232323811a83279acda10885.tar.gz cpython-07534a607bd3d2fd232323811a83279acda10885.tar.bz2 |
Comparison for timedelta, time, date and datetime objects: __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing. If no meaningful way to compare is known, saying "not equal" is
sensible. This allows things like
if adatetime in some_sequence:
and
somedict[adatetime] = whatever
to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.
It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().
Diffstat (limited to 'Include/ucnhash.h')
0 files changed, 0 insertions, 0 deletions