Title: Give an error if there is a variable annotation within a function but no signature · Issue #3948 · python/mypy · GitHub
Open Graph Title: Give an error if there is a variable annotation within a function but no signature · Issue #3948 · python/mypy
X Title: Give an error if there is a variable annotation within a function but no signature · Issue #3948 · python/mypy
Description: Mypy should perhaps give an error about a variable annotation in an otherwise unanotated function. Example: def f(): a: int = 'x' # Maybe this annotation should be an error? The rationale is that mypy will ignore the type annotation sinc...
Open Graph Description: Mypy should perhaps give an error about a variable annotation in an otherwise unanotated function. Example: def f(): a: int = 'x' # Maybe this annotation should be an error? The rationale is that m...
X Description: Mypy should perhaps give an error about a variable annotation in an otherwise unanotated function. Example: def f(): a: int = 'x' # Maybe this annotation should be an error? The rationale i...
Opengraph URL: https://github.com/python/mypy/issues/3948
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Give an error if there is a variable annotation within a function but no signature","articleBody":"Mypy should perhaps give an error about a variable annotation in an otherwise unanotated function. Example:\r\n\r\n```py\r\ndef f():\r\n a: int = 'x' # Maybe this annotation should be an error?\r\n```\r\n\r\nThe rationale is that mypy will ignore the type annotation since the function is still considered unannotated, but this is confusing because there is an annotation *within* the function so it can appear to be annotated.\r\n\r\nIf `--check-untyped-defs` is being used this error shouldn't be generated.\r\n\r\nOriginally reported in #3945.","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2017-09-12T16:32:22Z","url":"https://github.com/python/mypy/issues/3948"}
| 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:3ca24b40-1793-2a85-4bee-01dd08590750 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F8E:2573D7:1C13F4C:260DD59:6B0007E6 |
| html-safe-nonce | de50f59034544aa8c5a8d25c5c21e8d57634279dd8819907aec5f7b87a4d6d26 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjhFOjI1NzNENzoxQzEzRjRDOjI2MERENTk6NkIwMDA3RTYiLCJ2aXNpdG9yX2lkIjoiMjQxNTg1NDg1MzA4NDQxNTk3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d8c187667b54aa6a3943e9eab81df359cbd870c97dab031eb25cf54990b2e081 |
| hovercard-subject-tag | issue:257107211 |
| 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/3948/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86306965d5ba7097171fa0483fe81f6eeaf44ba76e302d4b37149a30d0025438/python/mypy/issues/3948 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86306965d5ba7097171fa0483fe81f6eeaf44ba76e302d4b37149a30d0025438/python/mypy/issues/3948 |
| og:image:alt | Mypy should perhaps give an error about a variable annotation in an otherwise unanotated function. Example: def f(): a: int = 'x' # Maybe this annotation should be an error? The rationale is that m... |
| 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 | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width