Title: gh-49766: Make date-datetime comparison more symmetric and flexible by serhiy-storchaka · Pull Request #114760 · python/cpython · GitHub
Open Graph Title: gh-49766: Make date-datetime comparison more symmetric and flexible by serhiy-storchaka · Pull Request #114760 · python/cpython
X Title: gh-49766: Make date-datetime comparison more symmetric and flexible by serhiy-storchaka · Pull Request #114760 · python/cpython
Description: 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. Issue: gh-49766
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/python/cpython/pull/114760
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cf34491c-c162-882e-2465-9179c9b7f5d5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D336:5105D:4705769:635DAE0:6A4F73C3 |
| html-safe-nonce | a1a6a885d6fe9f49080c3e667cc557a86082d0f37de595c5bb8be045f36e2267 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzM2OjUxMDVEOjQ3MDU3Njk6NjM1REFFMDo2QTRGNzNDMyIsInZpc2l0b3JfaWQiOiIzNzc3MzM3OTA3OTg5MTQ4NjExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6a54cc8e05f5ec06a749b8bcd986461c4120a05241d3d09ae72b211d7c40e41a |
| hovercard-subject-tag | pull_request:1702813579 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/114760/files |
| twitter:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| og:image:alt | 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 ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width