Skip to content

Commit

Permalink
bpo-34365: Update date object documentation (pythonGH-8814)
Browse files Browse the repository at this point in the history
Python 3.x does not fall back to comparing object addresses when comparing two `dt` objects.

<!-- issue-number: [bpo-34365](https://www.bugs.python.org/issue34365) -->
https://bugs.python.org/issue34365
<!-- /issue-number -->
  • Loading branch information
danishprakash authored and miss-islington committed Sep 11, 2018
1 parent 24bd50b commit 9c22379
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Doc/library/datetime.rst
Expand Up @@ -526,10 +526,9 @@ Notes:

(4)
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
:exc:`TypeError` if the other comparand isn't also a :class:`date` object.
However, ``NotImplemented`` is returned instead if the other comparand has a
date2.toordinal()``. Date comparison raises :exc:`TypeError` if
the other comparand isn't also a :class:`date` object. However,
``NotImplemented`` is returned instead if the other comparand has a
:meth:`timetuple` attribute. This hook gives other kinds of date objects a
chance at implementing mixed-type comparison. If not, when a :class:`date`
object is compared to an object of a different type, :exc:`TypeError` is raised
Expand Down

0 comments on commit 9c22379

Please sign in to comment.