Title: Make operator overloading overlapping checks more lenient · Issue #1264 · python/mypy · GitHub
Open Graph Title: Make operator overloading overlapping checks more lenient · Issue #1264 · python/mypy
X Title: Make operator overloading overlapping checks more lenient · Issue #1264 · python/mypy
Description: Currently the overlapping checks for __add__ / __radd__ and similar make it impossible to have reasonable types for the fractions std lib module (and probably also numbers). There are several potential related issues: If a base class has...
Open Graph Description: Currently the overlapping checks for __add__ / __radd__ and similar make it impossible to have reasonable types for the fractions std lib module (and probably also numbers). There are several poten...
X Description: Currently the overlapping checks for __add__ / __radd__ and similar make it impossible to have reasonable types for the fractions std lib module (and probably also numbers). There are several poten...
Opengraph URL: https://github.com/python/mypy/issues/1264
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make operator overloading overlapping checks more lenient","articleBody":"Currently the overlapping checks for `__add__` / `__radd__` and similar make it impossible to have reasonable types for the `fractions` std lib module (and probably also `numbers`).\n\nThere are several potential related issues:\n- If a base class has a dynamically typed operator method and it gets overridden with an annotated method, mypy may get confused (it shouldn't complain about dynamically typed methods).\n- The overlapping checks should perhaps not complain if multiple inheritance can break type safety, as if we do this we'll have to reject way too much basically valid code (or the checks become so complicated that it's difficult to give useful feedback for users).\n- We'll probably have to allow more flexibility around overriding overloaded functions so that a subclass can introduce new overload variants with fewer restrictions.\n- Overriding methods that use type variables with enumerated values may also be broken in cases where a subclass uses a different set of values.\n\nThis is just a placeholder issue -- I'll add more detail later. Perhaps create separate issues for all the above issues.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2016-03-02T18:29:16Z","url":"https://github.com/python/mypy/issues/1264"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a22d81bc-f07a-185b-a0a1-9b7f85b7d062 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D56:1F7A:D36F0A:1201193:6B000612 |
| html-safe-nonce | a87e3eaa63b987199affde2a492795fd9912e6283e2d89aa82654da7296df047 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDU2OjFGN0E6RDM2RjBBOjEyMDExOTM6NkIwMDA2MTIiLCJ2aXNpdG9yX2lkIjoiMjAxNTAzNTgyMTk4MzI3MDQxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5fdb32535517088984da4cb938da497e11ab4ffe68909ab0eb7bb77bc9979fc4 |
| hovercard-subject-tag | issue:137953342 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/mypy/1264/issue_layout |
| twitter:image | https://opengraph.githubassets.com/842cf337c7c88c6f1d995ab55b0964dd02ee1ae0a4719252a17e7f81d5fd0d8d/python/mypy/issues/1264 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/842cf337c7c88c6f1d995ab55b0964dd02ee1ae0a4719252a17e7f81d5fd0d8d/python/mypy/issues/1264 |
| og:image:alt | Currently the overlapping checks for __add__ / __radd__ and similar make it impossible to have reasonable types for the fractions std lib module (and probably also numbers). There are several poten... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width