]> granicus.if.org Git - python/commit
bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 13 Jul 2019 13:59:37 +0000 (06:59 -0700)
committerGitHub <noreply@github.com>
Sat, 13 Jul 2019 13:59:37 +0000 (06:59 -0700)
commit143672cf028740fc549e532c049559c522930c95
tree3561a6b51b33a40d1a2fe051500f3eeb9c027f52
parent5da83b417e48aecd7698387d3f37c603162fd46e
bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726)

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
(cherry picked from commit e6b46aafad3427463d6264a68824df4797e682f1)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
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]