Title: allow overloads to be distinguished by contained type of a generic · Issue #4159 · python/mypy · GitHub
Open Graph Title: allow overloads to be distinguished by contained type of a generic · Issue #4159 · python/mypy
X Title: allow overloads to be distinguished by contained type of a generic · Issue #4159 · python/mypy
Description: This is a follow-up to the discussion beginning at python/typing#253 (comment) Mypy's choice to not distinguish overload signatures by contained types rules out some natural API choices, e.g. @overload def map(ids: List[int]) -> Dict[int...
Open Graph Description: This is a follow-up to the discussion beginning at python/typing#253 (comment) Mypy's choice to not distinguish overload signatures by contained types rules out some natural API choices, e.g. @over...
X Description: This is a follow-up to the discussion beginning at python/typing#253 (comment) Mypy's choice to not distinguish overload signatures by contained types rules out some natural API choices, e.g. @...
Opengraph URL: https://github.com/python/mypy/issues/4159
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"allow overloads to be distinguished by contained type of a generic","articleBody":"This is a follow-up to the discussion beginning at https://github.com/python/typing/issues/253#issuecomment-235652393\r\n\r\nMypy's choice to not distinguish overload signatures by contained types rules out some natural API choices, e.g.\r\n\r\n```\r\n@overload\r\ndef map(ids: List[int]) -> Dict[int, MyObj]: ...\r\n\r\n@overload\r\ndef map(ids: List[str]) -> Dict[str, MyObj]: ...\r\n```\r\n \r\nWe've run into this limitation several times already at Instagram, and there aren't any nice workarounds for it. From a user point of view, the \"empty list\" rationale doesn't feel right; it seems like it should be possible to only error in specific calls with an unknown contained type.\r\n\r\nThere is some more discussion in the above-linked thread of how to handle this. In any case, I think it deserves tracking as a mypy limitation.","author":{"url":"https://github.com/carljm","@type":"Person","name":"carljm"},"datePublished":"2017-10-25T20:04:14Z","url":"https://github.com/python/mypy/issues/4159"}
| 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:511adb4a-0415-c0e9-5605-4766da44e9c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D8A2:22E079:1514223:1B9B190:6B000C54 |
| html-safe-nonce | f32abd31cf395c93d3763b81b1d6af106945bc2ce4f79367996f2f422d10c97d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEEyOjIyRTA3OToxNTE0MjIzOjFCOUIxOTA6NkIwMDBDNTQiLCJ2aXNpdG9yX2lkIjoiNjY5MTk0NzQxNjA2MjU1NzAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bfb1c333ee88a325f545f6848863501e6da5ef415e5c8b0d83e11ddacf0f3f2c |
| hovercard-subject-tag | issue:268530623 |
| 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/4159/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b98c58988e885c439ae367a73a7e7aa7de66263ee97a8c8ed3196ef27703a552/python/mypy/issues/4159 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b98c58988e885c439ae367a73a7e7aa7de66263ee97a8c8ed3196ef27703a552/python/mypy/issues/4159 |
| og:image:alt | This is a follow-up to the discussion beginning at python/typing#253 (comment) Mypy's choice to not distinguish overload signatures by contained types rules out some natural API choices, e.g. @over... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carljm |
| 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