Title: --warn-return-any is too specialized · Issue #2901 · python/mypy · GitHub
Open Graph Title: --warn-return-any is too specialized · Issue #2901 · python/mypy
X Title: --warn-return-any is too specialized · Issue #2901 · python/mypy
Description: Recently the --warn-return-any option was added which causes mypy to warn if returning a value with an Any type (#2854). @ddfisher pointed out the this is not very general: Thinking out loud here: this helps catch accidental Anys in one ...
Open Graph Description: Recently the --warn-return-any option was added which causes mypy to warn if returning a value with an Any type (#2854). @ddfisher pointed out the this is not very general: Thinking out loud here: ...
X Description: Recently the --warn-return-any option was added which causes mypy to warn if returning a value with an Any type (#2854). @ddfisher pointed out the this is not very general: Thinking out loud here: ...
Opengraph URL: https://github.com/python/mypy/issues/2901
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"--warn-return-any is too specialized","articleBody":"Recently the `--warn-return-any` option was added which causes mypy to warn if returning a value with an `Any` type (#2854). @ddfisher pointed out the this is not very general:\r\n\r\n> Thinking out loud here: this helps catch accidental Anys in one particular circumstance, but it might be nice to have something a bit more comprehensive as well. Perhaps we should consider adding a flag which disallows use of Any-typed values except as the right hand side of an assignment with a type comment (i.e. forcing all Anys to be immediately typed).\r\n\r\nI agree that #2854 seems too narrowly focused. I like @ddfisher's suggestion, with a few tweaks:\r\n\r\n* `Any` should probably be okay as a function argument type if the argument type is `Any` (or `object`).\r\n* Assigning an `Any` value to a variable with an `Any` / `object` type seems okay as well.\r\n* Narrowing down from an `Any` value using `isinstance` or `cast` should be allowed.","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2017-02-24T13:01:56Z","url":"https://github.com/python/mypy/issues/2901"}
| 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:42c50ebe-70b1-a2a7-b9c3-4e6eea8198b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CD6:27AD12:41B4A1:585091:6B002C47 |
| html-safe-nonce | 2da67eb656485902b51ee5e32b54b639176788ef97ec4fba2e332025fb69378c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0Q2OjI3QUQxMjo0MUI0QTE6NTg1MDkxOjZCMDAyQzQ3IiwidmlzaXRvcl9pZCI6Ijc4NDU5MzAwMjM0MjgwNDE3OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a37a2b5af89bb85ed6369563f789ac2cc9f92154db2609acaa211a260b757bd5 |
| hovercard-subject-tag | issue:210042985 |
| 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/2901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5afd566131f6ed0a84104f1d62d47891cb531cf5e2be0d20e8d33a78facca3b/python/mypy/issues/2901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5afd566131f6ed0a84104f1d62d47891cb531cf5e2be0d20e8d33a78facca3b/python/mypy/issues/2901 |
| og:image:alt | Recently the --warn-return-any option was added which causes mypy to warn if returning a value with an Any type (#2854). @ddfisher pointed out the this is not very general: Thinking out loud here: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width