Title: Setting `disallow_any = generics` in mypy.ini breaks `disallow_untyped_defs = True` · Issue #4075 · python/mypy · GitHub
Open Graph Title: Setting `disallow_any = generics` in mypy.ini breaks `disallow_untyped_defs = True` · Issue #4075 · python/mypy
X Title: Setting `disallow_any = generics` in mypy.ini breaks `disallow_untyped_defs = True` · Issue #4075 · python/mypy
Description: I have the following code (rpc_server.py): def get_tasks(self): return 'whatever' And mypy.ini: [mypy] disallow_untyped_defs = True disallow_any = generics I would expect to get an error because get_tasks is missing an argument annotatio...
Open Graph Description: I have the following code (rpc_server.py): def get_tasks(self): return 'whatever' And mypy.ini: [mypy] disallow_untyped_defs = True disallow_any = generics I would expect to get an error because ge...
X Description: I have the following code (rpc_server.py): def get_tasks(self): return 'whatever' And mypy.ini: [mypy] disallow_untyped_defs = True disallow_any = generics I would expect to get an error be...
Opengraph URL: https://github.com/python/mypy/issues/4075
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Setting `disallow_any = generics` in mypy.ini breaks `disallow_untyped_defs = True`","articleBody":"I have the following code (`rpc_server.py`):\r\n```\r\ndef get_tasks(self):\r\n return 'whatever'\r\n```\r\nAnd `mypy.ini`:\r\n```\r\n[mypy]\r\ndisallow_untyped_defs = True\r\ndisallow_any = generics\r\n```\r\nI would expect to get an error because `get_tasks` is missing an argument annotation and a return type annotation.\r\n\r\nHowever, `mypy --config-file /path/to/mypy.ini /path/to/rpc_server.py` gives no errors. When I remove `disallow_any = generics`, I get the expected error. I also get the expected error if I simply do `mypy --disallow-untyped-defs --disallow-any=generics`—somehow it makes a difference that I use a config file.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2017-10-08T19:42:04Z","url":"https://github.com/python/mypy/issues/4075"}
| 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:cc842e90-b022-a6eb-04e1-fb12658645b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E84:1EE55B:20ACB52:2CC7DE9:6B0029CB |
| html-safe-nonce | 66b37c376e6c297aa2cad9d0e8ba525270497be063ea241e692d9ef74bafc0d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTg0OjFFRTU1QjoyMEFDQjUyOjJDQzdERTk6NkIwMDI5Q0IiLCJ2aXNpdG9yX2lkIjoiNjI2NTAwMjQyNjM0MDc0NzcyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cfdd3492b8375356c0c3d1aa21ae534e8be8879b150b9a594e8c932c3bc0b468 |
| hovercard-subject-tag | issue:263745857 |
| 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/4075/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5260bc497e2ad56b10ff7df8a343a4a299f1cf1fe0775c4d0f9eb79f980610a8/python/mypy/issues/4075 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5260bc497e2ad56b10ff7df8a343a4a299f1cf1fe0775c4d0f9eb79f980610a8/python/mypy/issues/4075 |
| og:image:alt | I have the following code (rpc_server.py): def get_tasks(self): return 'whatever' And mypy.ini: [mypy] disallow_untyped_defs = True disallow_any = generics I would expect to get an error because ge... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| 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