Title: Proposal: use binder (or similar) to track which attributes are defined. · Issue #4019 · python/mypy · GitHub
Open Graph Title: Proposal: use binder (or similar) to track which attributes are defined. · Issue #4019 · python/mypy
X Title: Proposal: use binder (or similar) to track which attributes are defined. · Issue #4019 · python/mypy
Description: I couldn't find an issue for this, so here is an idea. Currently this passes mypy: class C: x: int c = C() c.x y: str y but obviously fails at runtime. Binder successfully tracks execution frames and type narrowing by assignments, it loo...
Open Graph Description: I couldn't find an issue for this, so here is an idea. Currently this passes mypy: class C: x: int c = C() c.x y: str y but obviously fails at runtime. Binder successfully tracks execution frames a...
X Description: I couldn't find an issue for this, so here is an idea. Currently this passes mypy: class C: x: int c = C() c.x y: str y but obviously fails at runtime. Binder successfully tracks execution fram...
Opengraph URL: https://github.com/python/mypy/issues/4019
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: use binder (or similar) to track which attributes are defined.","articleBody":"I couldn't find an issue for this, so here is an idea. Currently this passes mypy:\r\n```python\r\nclass C:\r\n x: int\r\nc = C()\r\nc.x\r\n\r\ny: str\r\ny\r\n```\r\nbut obviously fails at runtime. Binder successfully tracks execution frames and type narrowing by assignments, it looks like it can also track each ``Var`` whether it is still just \"declared\" or already defined. So that we can show errors like ``Variable 'var' may be uninitialized here``.\r\n\r\n**EDIT:** updated first example\r\n ","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2017-09-27T14:19:58Z","url":"https://github.com/python/mypy/issues/4019"}
| 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:61fdc563-d277-7bb0-5f09-32a622ff264a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C9E2:1A7566:4DF5CD:68C819:6B002F34 |
| html-safe-nonce | f564c939b38749a011f958c3b4993f5c96a288edd2873730757832763fab5e1f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUUyOjFBNzU2Njo0REY1Q0Q6NjhDODE5OjZCMDAyRjM0IiwidmlzaXRvcl9pZCI6IjI2NTkzNTQ4OTI4OTk5ODcyNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e0d7b1e329191df123117de6cfc190d24665c32291effd6b1b403f6540acf478 |
| hovercard-subject-tag | issue:260992543 |
| 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/4019/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1fe2940e3ac8bcd7178b656543dfb97ee49924f46f7a84bfd0e3ea04049ce92e/python/mypy/issues/4019 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fe2940e3ac8bcd7178b656543dfb97ee49924f46f7a84bfd0e3ea04049ce92e/python/mypy/issues/4019 |
| og:image:alt | I couldn't find an issue for this, so here is an idea. Currently this passes mypy: class C: x: int c = C() c.x y: str y but obviously fails at runtime. Binder successfully tracks execution frames a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilevkivskyi |
| 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