Title: Not detecting UnboundLocalError · Issue #2400 · python/mypy · GitHub
Open Graph Title: Not detecting UnboundLocalError · Issue #2400 · python/mypy
X Title: Not detecting UnboundLocalError · Issue #2400 · python/mypy
Description: mypy doesn't seem to warn about control flows which might lead to UnboundLocalError, e.g.: def func(arg): if arg: variable = 1 print(variable) func(0) Is this deliberate?
Open Graph Description: mypy doesn't seem to warn about control flows which might lead to UnboundLocalError, e.g.: def func(arg): if arg: variable = 1 print(variable) func(0) Is this deliberate?
X Description: mypy doesn't seem to warn about control flows which might lead to UnboundLocalError, e.g.: def func(arg): if arg: variable = 1 print(variable) func(0) Is this deliberate?
Opengraph URL: https://github.com/python/mypy/issues/2400
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Not detecting UnboundLocalError","articleBody":"mypy doesn't seem to warn about control flows which might lead to UnboundLocalError, e.g.:\r\n```\r\ndef func(arg):\r\n if arg:\r\n variable = 1\r\n print(variable)\r\n\r\nfunc(0)\r\n```\r\nIs this deliberate?","author":{"url":"https://github.com/tlynn","@type":"Person","name":"tlynn"},"datePublished":"2016-11-04T14:24:52Z","url":"https://github.com/python/mypy/issues/2400"}
| 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:4d1c4d05-a987-8f72-4ef1-93c2e17e37d5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9ABA:2148FB:1EF4F22:29F653B:6B00158E |
| html-safe-nonce | 370f6f1a3857babba772ac61fb284314703fa90accd71291d38469b5c5df12ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUJBOjIxNDhGQjoxRUY0RjIyOjI5RjY1M0I6NkIwMDE1OEUiLCJ2aXNpdG9yX2lkIjoiNTE3MjIzNDQyNTUwMDQzOTk1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eebe27b9f49c33b823f28722130426883d4cb8c53d81906a4662c92055792355 |
| hovercard-subject-tag | issue:187346392 |
| 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/2400/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2c5a5923e222f794f13cdc8c938dfb60b8476b151d537b4a123e8d9868e5434/python/mypy/issues/2400 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2c5a5923e222f794f13cdc8c938dfb60b8476b151d537b4a123e8d9868e5434/python/mypy/issues/2400 |
| og:image:alt | mypy doesn't seem to warn about control flows which might lead to UnboundLocalError, e.g.: def func(arg): if arg: variable = 1 print(variable) func(0) Is this deliberate? |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tlynn |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width