]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-37579: Improve equality behavior for pure Python datetime and time (GH...
authorXtreak <tir.karthi@gmail.com>
Sun, 14 Jul 2019 10:13:59 +0000 (15:43 +0530)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 14 Jul 2019 10:13:59 +0000 (03:13 -0700)
commitc6b31061997526b31961ec34328408ca421f51fc
treeda14b1cae73b44b96bc93c7c3c4fcca2417daec9
parent5631e381a6fbc471896b5562d542be0a6befa797
[3.7] bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726) (GH-14745)

Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation.

This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation.

[bpo-37579](https://bugs.python.org/issue37579)
(cherry picked from commit e6b46aafad3427463d6264a68824df4797e682f1)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
https://bugs.python.org/issue37579
Lib/datetime.py
Lib/test/datetimetester.py
Misc/NEWS.d/next/Library/2019-07-13-10-59-43.bpo-37579.B1Tq9i.rst [new file with mode: 0644]