Title: Create a plugin to handle singledispatch · Issue #2904 · python/mypy · GitHub
Open Graph Title: Create a plugin to handle singledispatch · Issue #2904 · python/mypy
X Title: Create a plugin to handle singledispatch · Issue #2904 · python/mypy
Description: For me, this code: from functools import singledispatch @singledispatch def cmp(other, match): return match in (..., other) @cmp.register(type) def _(other, match): return isinstance(match, other)` results in the mypy error: severity: 'E...
Open Graph Description: For me, this code: from functools import singledispatch @singledispatch def cmp(other, match): return match in (..., other) @cmp.register(type) def _(other, match): return isinstance(match, other)`...
X Description: For me, this code: from functools import singledispatch @singledispatch def cmp(other, match): return match in (..., other) @cmp.register(type) def _(other, match): return isinstance(match, other)`...
Opengraph URL: https://github.com/python/mypy/issues/2904
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create a plugin to handle singledispatch","articleBody":"For me, this code:\r\n\r\n```\r\nfrom functools import singledispatch\r\n@singledispatch\r\ndef cmp(other, match):\r\n return match in (..., other)\r\n\r\n@cmp.register(type)\r\ndef _(other, match):\r\n return isinstance(match, other)`\r\n```\r\nresults in the mypy error:\r\n> severity: 'Error'\r\n> message: 'error:'overload' decorator expected'\r\n\r\non the line @cmp.register(type)\r\n\r\nmypy version:\r\n\r\n> PS C:\\Program Files (x86)\\Python36-32> .\\scripts\\mypy.bat --version\r\n> mypy 0.471\r\n> PS C:\\Program Files (x86)\\Python36-32>\r\n\r\nWhat should I do to resolve the error?","author":{"url":"https://github.com/gbritton1","@type":"Person","name":"gbritton1"},"datePublished":"2017-02-24T18:58:50Z","url":"https://github.com/python/mypy/issues/2904"}
| 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:4c76ec22-e63a-c559-c955-ac6f015737c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB76:20F649:267D85:3631AB:6B006A49 |
| html-safe-nonce | be4eec63be306836fe1e4c6e008d82daff8ba41f18da31e14b1eb5c07fc2d024 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjc2OjIwRjY0OToyNjdEODU6MzYzMUFCOjZCMDA2QTQ5IiwidmlzaXRvcl9pZCI6IjEwOTk2NTQ2MzQ4MDIyNzY5MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4188c026a33ee5562458168f2478a4c1d72773f45c665f59ff357c5b8d92c3e0 |
| hovercard-subject-tag | issue:210129859 |
| 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/2904/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6ec5e98f5cb06045ff1458551c65f0d4b2853699228a95dbf7991e0937b3ef62/python/mypy/issues/2904 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6ec5e98f5cb06045ff1458551c65f0d4b2853699228a95dbf7991e0937b3ef62/python/mypy/issues/2904 |
| og:image:alt | For me, this code: from functools import singledispatch @singledispatch def cmp(other, match): return match in (..., other) @cmp.register(type) def _(other, match): return isinstance(match, other)`... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gbritton1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| 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 | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width