Message323314
The 3.x datetime documentation contains the following footnote:
> In other words, date1 < date2 if and only if date1.toordinal() < date2.toordinal(). In order to stop comparison from falling back to the default scheme of comparing object addresses, date comparison normally raises TypeError if the other comparand isn’t also a date object. However, NotImplemented is returned instead if the other comparand has a timetuple() attribute. This hook gives other kinds of date objects a chance at implementing mixed-type comparison. If not, when a date object is compared to an object of a different type, TypeError is raised unless the comparison is == or !=. The latter cases return False or True, respectively.
But in 3.x, comparison no longer falls back to comparing object addresses. Also, some of the comments on issue 8005 seem to suggest that this footnote is not actually true in 3.x (aside from the first sentence, of course). But regardless, the footnote should not refer to a long dead interpreter behavior as if it were still around. |
|
Date |
User |
Action |
Args |
2018-08-09 05:03:49 | Kevin.Norris | set | recipients:
+ Kevin.Norris, docs@python |
2018-08-09 05:03:49 | Kevin.Norris | set | messageid: <1533791029.87.0.56676864532.issue34365@psf.upfronthosting.co.za> |
2018-08-09 05:03:49 | Kevin.Norris | link | issue34365 messages |
2018-08-09 05:03:49 | Kevin.Norris | create | |
|