Title: Mypy internal error with attrs frozen classes with property overrides attribute · Issue #7918 · python/mypy · GitHub
Open Graph Title: Mypy internal error with attrs frozen classes with property overrides attribute · Issue #7918 · python/mypy
X Title: Mypy internal error with attrs frozen classes with property overrides attribute · Issue #7918 · python/mypy
Description: Bug: import attr @attr.s(frozen=False) class A: x: int = attr.ib(init=False) @attr.s(frozen=True) class B(A): @property def x(self) -> int: return 2 I got error: INTERNAL ERROR I expect run mypy without internal errors python 3.6.8 mypy ...
Open Graph Description: Bug: import attr @attr.s(frozen=False) class A: x: int = attr.ib(init=False) @attr.s(frozen=True) class B(A): @property def x(self) -> int: return 2 I got error: INTERNAL ERROR I expect run mypy wi...
X Description: Bug: import attr @attr.s(frozen=False) class A: x: int = attr.ib(init=False) @attr.s(frozen=True) class B(A): @property def x(self) -> int: return 2 I got error: INTERNAL ERROR I expect run mypy...
Opengraph URL: https://github.com/python/mypy/issues/7918
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Mypy internal error with attrs frozen classes with property overrides attribute","articleBody":"Bug:\r\n```\r\nimport attr\r\n\r\n@attr.s(frozen=False)\r\nclass A:\r\n x: int = attr.ib(init=False)\r\n\r\n@attr.s(frozen=True)\r\nclass B(A):\r\n @property\r\n def x(self) -> int:\r\n return 2\r\n```\r\n* I got `error: INTERNAL ERROR`\r\n* I expect run mypy without internal errors \r\n\r\npython 3.6.8\r\nmypy version: 0.750+dev.84126ab9985844d8cda3809688034af895fdaf7c\r\n\r\n* mypy flags\r\n```\r\nignore_missing_imports = True\r\ndisallow_incomplete_defs = True\r\ndisallow_untyped_calls = True\r\ndisallow_untyped_defs = False\r\n```\r\n* Traceback\r\n```\r\nTraceback (most recent call last):\r\n File \"mypy\", line 10, in \u003cmodule>\r\n sys.exit(console_entry())\r\n File \"mypy/__main__.py\", line 8, in console_entry\r\n main(None, sys.stdout, sys.stderr)\r\n File \"mypy/main.py\", line 93, in main\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"mypy/build.py\", line 167, in build\r\n sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr, extra_plugins\r\n File \"mypy/build.py\", line 235, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"mypy/build.py\", line 2620, in dispatch\r\n process_graph(graph, manager)\r\n File \"mypy/build.py\", line 2929, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"mypy/build.py\", line 3022, in process_stale_scc\r\n mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)\r\n File \"mypy/semanal_main.py\", line 77, in semantic_analysis_for_scc\r\n process_top_levels(graph, scc, patches)\r\n File \"mypy/semanal_main.py\", line 202, in process_top_levels\r\n patches)\r\n File \"mypy/semanal_main.py\", line 330, in semantic_analyze_target\r\n active_type=active_type)\r\n File \"mypy/semanal.py\", line 378, in refresh_partial\r\n self.refresh_top_level(node)\r\n File \"mypy/semanal.py\", line 389, in refresh_top_level\r\n self.accept(d)\r\n File \"mypy/semanal.py\", line 4639, in accept\r\n node.accept(self)\r\n File \"mypy/nodes.py\", line 927, in accept\r\n return visitor.visit_class_def(self)\r\n File \"mypy/semanal.py\", line 1022, in visit_class_def\r\n self.analyze_class(defn)\r\n File \"mypy/semanal.py\", line 1099, in analyze_class\r\n self.analyze_class_body_common(defn)\r\n File \"mypy/semanal.py\", line 1108, in analyze_class_body_common\r\n self.apply_class_plugin_hooks(defn)\r\n File \"mypy/semanal.py\", line 1154, in apply_class_plugin_hooks\r\n hook(ClassDefContext(defn, decorator, self))\r\n File \"mypy/plugins/attrs.py\", line 295, in attr_class_maker_callback\r\n _make_frozen(ctx, attributes)\r\n File \"mypy/plugins/attrs.py\", line 627, in _make_frozen\r\n assert isinstance(node, Var)\r\nAssertionError: \r\n```","author":{"url":"https://github.com/ibrque","@type":"Person","name":"ibrque"},"datePublished":"2019-11-10T01:27:39Z","url":"https://github.com/python/mypy/issues/7918"}
| 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:60bdb771-028c-ab18-2a5b-a324676e9819 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEEC:07D0:1EC4597:28B6BBB:6B004777 |
| html-safe-nonce | 093ac3e832729231bc186076a4d4bad9f59236f5c292a68f00208db573b9c774 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUVDOjA3RDA6MUVDNDU5NzoyOEI2QkJCOjZCMDA0Nzc3IiwidmlzaXRvcl9pZCI6IjI4MzkyMzg3MTAzNTA4NTgxMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 08bbff678f90435c9e80d56b30bdd62040892db140cba133d759b24668ab8761 |
| hovercard-subject-tag | issue:520538580 |
| 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/7918/issue_layout |
| twitter:image | https://opengraph.githubassets.com/33bf53780752fa7a3cc820a2af97d1394fa253c0b0f544af0a225bf6a8d74197/python/mypy/issues/7918 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/33bf53780752fa7a3cc820a2af97d1394fa253c0b0f544af0a225bf6a8d74197/python/mypy/issues/7918 |
| og:image:alt | Bug: import attr @attr.s(frozen=False) class A: x: int = attr.ib(init=False) @attr.s(frozen=True) class B(A): @property def x(self) -> int: return 2 I got error: INTERNAL ERROR I expect run mypy wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ibrque |
| 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