• Tim Peters's avatar
    Comparison for timedelta, time, date and datetime objects: __eq__ and · 07534a60
    Tim Peters yazdı
    __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().
    07534a60
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...