[Python-ideas] datetime: Support infinity

random832 at fastmail.us random832 at fastmail.us
Thu Jan 29 20:23:18 CET 2015


On Thu, Jan 29, 2015, at 14:14, Ethan Furman wrote:
> On 01/29/2015 11:09 AM, Chris Barker wrote:
> > On Thu, Jan 29, 2015 at 10:10 AM, random832 wrote:
> >> 
> >> Python 2 raises exception from __lt__,
> > 
> > yeah, that's what I got -- we're on 2 for now. You'd think there wold
> > be a way to do it -- but I don't see a "reflected" versions of the
> > comparison operators.
> 
> Raising an exception was a bug.  The comparison operators are their own
> reflection.

Or, more precisely, they are *each other's* reflection (__gt__ being the
reflection of __lt__).

This works fine in 2.7 for types that properly return NotImplemented.
This is just a bug in Python 2's datetime module.


More information about the Python-ideas mailing list