Title: SymbolTableNode.kind conflates orthogonal characteristics · Issue #3440 · python/mypy · GitHub
Open Graph Title: SymbolTableNode.kind conflates orthogonal characteristics · Issue #3440 · python/mypy
X Title: SymbolTableNode.kind conflates orthogonal characteristics · Issue #3440 · python/mypy
Description: I encountered this issue in working on #3435 -- it is the reason that PR stops short of implementing support for module aliasing assignment outside of module global scope. When I remove the not self.is_module_scope() guard in that PR, th...
Open Graph Description: I encountered this issue in working on #3435 -- it is the reason that PR stops short of implementing support for module aliasing assignment outside of module global scope. When I remove the not sel...
X Description: I encountered this issue in working on #3435 -- it is the reason that PR stops short of implementing support for module aliasing assignment outside of module global scope. When I remove the not sel...
Opengraph URL: https://github.com/python/mypy/issues/3440
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SymbolTableNode.kind conflates orthogonal characteristics","articleBody":"I encountered this issue in working on #3435 -- it is the reason that PR stops short of implementing support for module aliasing assignment outside of module global scope. When I remove the `not self.is_module_scope()` guard in that PR, [this line](https://github.com/python/mypy/compare/master...carljm:module-alias-not-module-scope?expand=1#diff-4489f8217a37fa27005419113dfac3bfR1470) in the added test fails with an opaque error `A: main:5: error: Member \"m2\" is not assignable`.\r\n\r\nI haven't yet traced through to fully understand what is happening, but I have a strong suspicion that the problem is due to `SymbolTableNode.kind` representing orthogonal characteristics of the symbol table node with mutually exclusive enum values.\r\n\r\n`SymbolTableNode.kind` can take one of these values: https://github.com/python/mypy/blob/master/mypy/nodes.py#L34-L53\r\n\r\nThis enum isn't capable of representing the fact that a `MODULE_REF` might occur at global, member, or local level. In the test linked above, I think the symbol table entry really should be both `MDEF` and `MODULE_REF`, but that isn't representable; when my code tries to change the class attribute symbol table node from `MDEF` to `MODULE_REF`, things break. I think mypy implicitly assumes that `MODULE_REF` is global.\r\n\r\nHopefully I can find time to explore this further, verify the suspicion, and investigate possible solutions. Just wanted to record my findings so far publicly before leaving PyCon sprint. Comments/guidance welcome!","author":{"url":"https://github.com/carljm","@type":"Person","name":"carljm"},"datePublished":"2017-05-24T18:32:26Z","url":"https://github.com/python/mypy/issues/3440"}
| 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:3c1981a1-c4fc-b424-9afb-5b95508cefc1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A87A:11BB24:1C3442C:2613B36:6B0003DB |
| html-safe-nonce | b2c8464c2812ea8b636957ac3e78a19385c4c401924a846cc7cd7d855b7f52fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODdBOjExQkIyNDoxQzM0NDJDOjI2MTNCMzY6NkIwMDAzREIiLCJ2aXNpdG9yX2lkIjoiNzIxNDA4MTQ3MTY1OTYzOTc3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e3b9d660301b8ebc70cd3d1d72cfb46477c0f2de938de1977712dcde94a9fe10 |
| hovercard-subject-tag | issue:231131870 |
| 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/3440/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e2944eafbbbb94379d7336ca1f9a0378ceed95fd22da2a3aa2d939676b88d656/python/mypy/issues/3440 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e2944eafbbbb94379d7336ca1f9a0378ceed95fd22da2a3aa2d939676b88d656/python/mypy/issues/3440 |
| og:image:alt | I encountered this issue in working on #3435 -- it is the reason that PR stops short of implementing support for module aliasing assignment outside of module global scope. When I remove the not sel... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carljm |
| 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