diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-02-11 13:06:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-11 13:06:43 +0200 |
commit | b1043607884d774acabd255ecdcebb159f76a2fb (patch) | |
tree | 4621a610aa02126372c5a23d5ee55d7c2d5a9f5d /Lib/test/test_pydoc.py | |
parent | d9d6909697501a2604d5895f9f88aeec61274ab0 (diff) | |
download | cpython-b1043607884d774acabd255ecdcebb159f76a2fb.tar.gz cpython-b1043607884d774acabd255ecdcebb159f76a2fb.zip |
gh-49766: Make date-datetime comparison more symmetric and flexible (GH-114760)
Now the special comparison methods like `__eq__` and `__lt__` return
NotImplemented if one of comparands is date and other is datetime
instead of ignoring the time part and the time zone or forcefully
return "not equal" or raise TypeError.
It makes comparison of date and datetime subclasses more symmetric
and allows to change the default behavior by overriding
the special comparison methods in subclasses.
It is now the same as if date and datetime was independent classes.
Diffstat (limited to 'Lib/test/test_pydoc.py')
0 files changed, 0 insertions, 0 deletions