mirror of
https://github.com/python/cpython.git
synced 2024-12-01 11:15:56 +01:00
8d81a012ef
compare against "the other" argument, we raise TypeError, in order to prevent comparison from falling back to the default (and worse than useless, in this case) comparison by object address. That's fine so far as it goes, but leaves no way for another date/datetime object to make itself comparable to our objects. For example, it leaves Marc-Andre no way to teach mxDateTime dates how to compare against Python dates. Discussion on Python-Dev raised a number of impractical ideas, and the simple one implemented here: when we don't know how to compare against "the other" argument, we raise TypeError *unless* the other object has a timetuple attr. In that case, we return NotImplemented instead, and Python will give the other object a shot at handling the comparison then. Note that comparisons of time and timedelta objects still suffer the original problem, though. |
||
---|---|---|
.. | ||
expat | ||
_bsddb.c | ||
_codecsmodule.c | ||
_curses_panel.c | ||
_cursesmodule.c | ||
_hotshot.c | ||
_localemodule.c | ||
_randommodule.c | ||
_sre.c | ||
_ssl.c | ||
_testcapimodule.c | ||
_tkinter.c | ||
_weakref.c | ||
.cvsignore | ||
addrinfo.h | ||
almodule.c | ||
ar_beos | ||
arraymodule.c | ||
audioop.c | ||
binascii.c | ||
bsddbmodule.c | ||
bz2module.c | ||
ccpython.cc | ||
cdmodule.c | ||
cgen.py | ||
cgensupport.c | ||
cgensupport.h | ||
clmodule.c | ||
cmathmodule.c | ||
config.c.in | ||
cPickle.c | ||
cryptmodule.c | ||
cStringIO.c | ||
cstubs | ||
datetimemodule.c | ||
dbmmodule.c | ||
dlmodule.c | ||
errnomodule.c | ||
fcntlmodule.c | ||
flmodule.c | ||
fmmodule.c | ||
fpectlmodule.c | ||
fpetestmodule.c | ||
gcmodule.c | ||
gdbmmodule.c | ||
getaddrinfo.c | ||
getbuildinfo.c | ||
getnameinfo.c | ||
getpath.c | ||
glmodule.c | ||
grpmodule.c | ||
imageop.c | ||
imgfile.c | ||
ld_so_aix | ||
ld_so_beos | ||
linuxaudiodev.c | ||
main.c | ||
makesetup | ||
makexp_aix | ||
mathmodule.c | ||
md5.h | ||
md5c.c | ||
md5module.c | ||
mmapmodule.c | ||
mpzmodule.c | ||
nismodule.c | ||
operator.c | ||
ossaudiodev.c | ||
parsermodule.c | ||
pcre-int.h | ||
pcre.h | ||
pcremodule.c | ||
posixmodule.c | ||
puremodule.c | ||
pwdmodule.c | ||
pyexpat.c | ||
pypcre.c | ||
python.c | ||
readline.c | ||
regexmodule.c | ||
regexpr.c | ||
regexpr.h | ||
resource.c | ||
rgbimgmodule.c | ||
rotormodule.c | ||
selectmodule.c | ||
Setup.config.in | ||
Setup.dist | ||
sgimodule.c | ||
shamodule.c | ||
signalmodule.c | ||
socketmodule.c | ||
socketmodule.h | ||
sre_constants.h | ||
sre.h | ||
stropmodule.c | ||
structmodule.c | ||
sunaudiodev.c | ||
svmodule.c | ||
symtablemodule.c | ||
syslogmodule.c | ||
termios.c | ||
testcapi_long.h | ||
threadmodule.c | ||
timemodule.c | ||
timing.h | ||
timingmodule.c | ||
tkappinit.c | ||
unicodedata_db.h | ||
unicodedata.c | ||
unicodename_db.h | ||
xreadlinesmodule.c | ||
xxmodule.c | ||
xxsubtype.c | ||
yuv.h | ||
yuvconvert.c | ||
zipimport.c | ||
zlibmodule.c |