Title: type hint: how should type of lru_cache be defined? · Issue #5107 · python/mypy · GitHub
Open Graph Title: type hint: how should type of lru_cache be defined? · Issue #5107 · python/mypy
X Title: type hint: how should type of lru_cache be defined? · Issue #5107 · python/mypy
Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Open Graph Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
X Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Opengraph URL: https://github.com/python/mypy
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"type hint: how should type of lru_cache be defined?","articleBody":"Note: if you are reporting a wrong signature of a function or a class in\r\nthe standard library, then the typeshed tracker is better suited\r\nfor this report: https://github.com/python/typeshed/issues\r\n\r\nPlease provide more information to help us understand the issue:\r\n\r\n* Are you reporting a bug, or opening a feature request? bug\r\n* Please insert below the code you are checking with mypy,\r\n or a mock-up repro if the source is private. We would appreciate\r\n if you try to simplify your case to a minimal repro.\r\n\r\n```python\r\n@lru_cache(maxsize=1)\r\ndef get_response_from_api() -> List[ApiObject]:\r\n url = _get_api_url()\r\n response = requests.get(url).text\r\n return json.loads(response, object_hook=_create_api_obj)\r\n```\r\n* What is the actual behavior/output?\r\n> error: Untyped decorator makes function \"get_response_from_api\" untyped\r\n* What is the behavior/output you expect?\r\nit should not emit an error, alternatively there should be instructions what to do.\r\n\r\n* What are the versions of mypy and Python you are using?\r\nmypy 0.600\r\npython 3.6.5\r\n Do you see the same issue after installing mypy from Git master? did not try\r\n\r\n* What are the mypy flags you are using? (For example --strict-optional)\r\nmypy predictor --ignore-missing-imports --strict\r\n* If mypy crashed with a traceback, please paste\r\n the full traceback below.\r\n\r\nAlso asked in SO: https://stackoverflow.com/questions/50495759/type-hint-how-should-type-of-lru-cache-be-defined\r\n\r\n\r\n","author":{"url":"https://github.com/david-gang","@type":"Person","name":"david-gang"},"datePublished":"2018-05-24T07:40:17Z","url":"https://github.com/python/mypy/issues/5107"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:89615d4f-dfe8-cf90-eb54-ce224ae183f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBEA:30501:2B4F5C:3AF72A:6B00263A |
| html-safe-nonce | 141b6fda8c4006940442ce01d7ccf5356669c876e16201ad12c316868385958e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkVBOjMwNTAxOjJCNEY1QzozQUY3MkE6NkIwMDI2M0EiLCJ2aXNpdG9yX2lkIjoiMjgxNDkyOTE5OTc1MDQ1Njg5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c5d25c716d998ad876c28334c8e78e33a83501125a825f0a67b3b00e7b6048f3 |
| hovercard-subject-tag | repository:7053637 |
| 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/python/mypy/issues/5107 |
| twitter:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| og:image:alt | Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-cache |
| 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