Title: @overloading an @lru_cache'd function crashes mypy · Issue #9112 · python/mypy · GitHub
Open Graph Title: @overloading an @lru_cache'd function crashes mypy · Issue #9112 · python/mypy
X Title: @overloading an @lru_cache'd function crashes mypy · Issue #9112 · python/mypy
Description: Simple to reproduce, mypy 0.782. #!/usr/bin/env python from typing import * from functools import lru_cache @overload def f(a: str, b: str) -> int: ... @overload def f(a: str) -> str: ... @lru_cache def f(a: str, b: Optional[str] = None)...
Open Graph Description: Simple to reproduce, mypy 0.782. #!/usr/bin/env python from typing import * from functools import lru_cache @overload def f(a: str, b: str) -> int: ... @overload def f(a: str) -> str: ... @lru_cach...
X Description: Simple to reproduce, mypy 0.782. #!/usr/bin/env python from typing import * from functools import lru_cache @overload def f(a: str, b: str) -> int: ... @overload def f(a: str) -> str: ... @lr...
Opengraph URL: https://github.com/python/mypy/issues/9112
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@overloading an @lru_cache'd function crashes mypy","articleBody":"Simple to reproduce, mypy 0.782.\r\n\r\n```py\r\n#!/usr/bin/env python\r\nfrom typing import *\r\nfrom functools import lru_cache\r\n\r\n@overload\r\ndef f(a: str, b: str) -> int: ...\r\n\r\n@overload\r\ndef f(a: str) -> str: ...\r\n\r\n@lru_cache\r\ndef f(a: str, b: Optional[str] = None) -> Union[str, int]:\r\n if b is not None:\r\n return 123\r\n else:\r\n return 'abc'\r\n```\r\n\r\n```sh\r\nmypy --strict --show-traceback .\r\n```\r\n\r\n```\r\n./example.py:5: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 0.782\r\nTraceback (most recent call last):\r\n File \"mypy/checker.py\", line 401, in accept\r\n File \"mypy/nodes.py\", line 515, in accept\r\n File \"mypy/checker.py\", line 434, in visit_overloaded_func_def\r\n File \"mypy/checker.py\", line 461, in _visit_overloaded_func_def\r\n File \"mypy/checker.py\", line 482, in check_overlapping_overloads\r\nAssertionError: \r\n./example.py:5: : note: use --pdb to drop into pdb\r\n```\r\n\r\nAlso happens with master: version: 0.790+dev.ffdbeb3d47ccb2d9691b36993be0a18e0718d997","author":{"url":"https://github.com/akdor1154","@type":"Person","name":"akdor1154"},"datePublished":"2020-07-09T01:55:27Z","url":"https://github.com/python/mypy/issues/9112"}
| 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:5cdd2cbc-3739-1d36-ae90-5b5a6805499f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C410:2B41BC:26D62D:3444BB:6B002402 |
| html-safe-nonce | ed8dd1f3ee1bf2899defe45bf1b7e7a199d19a6ac5f334e126e05bcb11428fc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDEwOjJCNDFCQzoyNkQ2MkQ6MzQ0NEJCOjZCMDAyNDAyIiwidmlzaXRvcl9pZCI6IjcxNzczMDQ3OTE5ODU0MzE1NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 939020005061f118c026e9cd18f1c7c9bb8f0277ed5acacea5e9b124256037b3 |
| hovercard-subject-tag | issue:653703002 |
| 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/9112/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b3f634b43522b2e2dc0d5185e63d1b048b6ea0f6a70a1d308e6c1e8f1183b341/python/mypy/issues/9112 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b3f634b43522b2e2dc0d5185e63d1b048b6ea0f6a70a1d308e6c1e8f1183b341/python/mypy/issues/9112 |
| og:image:alt | Simple to reproduce, mypy 0.782. #!/usr/bin/env python from typing import * from functools import lru_cache @overload def f(a: str, b: str) -> int: ... @overload def f(a: str) -> str: ... @lru_cach... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akdor1154 |
| 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