Title: Mypy blows up sometimes with bad reverse method · Issue #5337 · python/mypy · GitHub
Open Graph Title: Mypy blows up sometimes with bad reverse method · Issue #5337 · python/mypy
X Title: Mypy blows up sometimes with bad reverse method · Issue #5337 · python/mypy
Description: When I run mypy (no special arguments) on the following code (with --show-traceback): class Foo: def __radd__(self, other: Foo, other2: Foo = None) -> Foo: return self it fails with this error: test_radd.py:2: error: INTERNAL ERROR -- pl...
Open Graph Description: When I run mypy (no special arguments) on the following code (with --show-traceback): class Foo: def __radd__(self, other: Foo, other2: Foo = None) -> Foo: return self it fails with this error: tes...
X Description: When I run mypy (no special arguments) on the following code (with --show-traceback): class Foo: def __radd__(self, other: Foo, other2: Foo = None) -> Foo: return self it fails with this error: ...
Opengraph URL: https://github.com/python/mypy/issues/5337
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy blows up sometimes with bad reverse method","articleBody":"When I run mypy (no special arguments) on the following code (with `--show-traceback`):\r\n```python\r\nclass Foo:\r\n def __radd__(self, other: Foo, other2: Foo = None) -> Foo:\r\n return self\r\n```\r\nit fails with this error:\r\n```\r\ntest_radd.py:2: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.610\r\nTraceback (most recent call last):\r\n ...\r\n ...\r\n File \"/Users/sidharthkapur/.local/share/virtualenvs/mypy-test-VQzn8vfh/lib/python3.7/site-packages/mypy/checker.py\", line 957, in check_reverse_op_method\r\n assert len(reverse_type.arg_types) == 2\r\nAssertionError: \r\ntest_radd.py:2: : note: use --pdb to drop into pdb\r\n```\r\n\r\nThe expected behavior should be the same as in the following, similar example:\r\n```python\r\nclass Foo:\r\n def __radd__(self, other: Foo, other2: Foo) -> Foo:\r\n return self\r\n```\r\nwhich gracefully fails with the message:\r\n```\r\ntest_radd.py:2: error: Invalid signature \"def (test_radd.Foo, test_radd.Foo, test_radd.Foo) -> test_radd.Foo\"\r\n```\r\n\r\n* Python version: 3.7.0\r\n* Mypy version: 0.610\r\n","author":{"url":"https://github.com/sid-kap","@type":"Person","name":"sid-kap"},"datePublished":"2018-07-09T21:58:13Z","url":"https://github.com/python/mypy/issues/5337"}
| 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:add575a7-21f9-1a83-45db-13ab95e007b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8424:2FF516:157B7D:1D2F7C:6B001F1A |
| html-safe-nonce | 920190b66989376b73cd37aa4ac1e28283a54665ca6173c4fcb81b118bc11029 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDI0OjJGRjUxNjoxNTdCN0Q6MUQyRjdDOjZCMDAxRjFBIiwidmlzaXRvcl9pZCI6IjgxNTE4OTMzODc1MzcwMzA5MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f4db65193962583c3b6fc0cb30b2421392159db27e12b401f1b65cd131bf84f7 |
| hovercard-subject-tag | issue:339621730 |
| 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/5337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d1c01af9f6e5925e3eeb80a6a08b241cf1a52fbd40b84e971089cc29d9a885be/python/mypy/issues/5337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d1c01af9f6e5925e3eeb80a6a08b241cf1a52fbd40b84e971089cc29d9a885be/python/mypy/issues/5337 |
| og:image:alt | When I run mypy (no special arguments) on the following code (with --show-traceback): class Foo: def __radd__(self, other: Foo, other2: Foo = None) -> Foo: return self it fails with this error: tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sid-kap |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width