A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-January/032414.html below:

[Python-Dev] Mixed-type datetime comparisons

[Python-Dev] Mixed-type datetime comparisons [Python-Dev] Mixed-type datetime comparisonsTim Peters tim@zope.com
Fri, 24 Jan 2003 17:34:51 -0500
I checked in changes so that datetime and date comparison return
NotImplemented (instead of raising TypeError) if "the other" argument has a
timetuple attribute.  This gives other kinds of datetime objects a chance to
intercept the comparison and implement it themselves.

Note that this doesn't help for mixed-type time or timedelta comparison:
datetime's time and timedelta objects don't have timetuple methods
themselves, and their comparison implementations still raise TypeError
whenever they don't recognize the other comparand's type (this is needed to
prevent comparison against objects of arbitrary types from falling back to
the default comparison of object addresses).




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4