Title: problem with `ABCMeta` as base class inside an iter without annotation · Issue #9838 · python/mypy · GitHub
Open Graph Title: problem with `ABCMeta` as base class inside an iter without annotation · Issue #9838 · python/mypy
X Title: problem with `ABCMeta` as base class inside an iter without annotation · Issue #9838 · python/mypy
Description: Crash Report Mypy crashed, the code snippet below is enough to reproduce that. Traceback bug.py:34: error: INTERNAL ERROR -- Please try using mypy master on Github: https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-my...
Open Graph Description: Crash Report Mypy crashed, the code snippet below is enough to reproduce that. Traceback bug.py:34: error: INTERNAL ERROR -- Please try using mypy master on Github: https://mypy.rtfd.io/en/latest/c...
X Description: Crash Report Mypy crashed, the code snippet below is enough to reproduce that. Traceback bug.py:34: error: INTERNAL ERROR -- Please try using mypy master on Github: https://mypy.rtfd.io/en/latest/c...
Opengraph URL: https://github.com/python/mypy/issues/9838
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"problem with `ABCMeta` as base class inside an iter without annotation","articleBody":"\u003c!--\r\n Use this form only if mypy reports an \"INTERNAL ERROR\" and/or gives a traceback.\r\n Please include the traceback and all other messages below (use `mypy --show-traceback`).\r\n-->\r\n\r\n**Crash Report**\r\n\r\nMypy crashed, the code snippet below is enough to reproduce that.\r\n\r\n**Traceback**\r\n\r\n```\r\nbug.py:34: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 0.790\r\nTraceback (most recent call last):\r\n File \"/usr/bin/mypy\", line 33, in \u003cmodule>\r\n sys.exit(load_entry_point('mypy==0.790', 'console_scripts', 'mypy')())\r\n File \"/usr/lib/python3.9/site-packages/mypy/__main__.py\", line 8, in console_entry\r\n main(None, sys.stdout, sys.stderr)\r\n File \"/usr/lib/python3.9/site-packages/mypy/main.py\", line 90, in main\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 180, in build\r\n result = _build(\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 254, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 2630, in dispatch\r\n process_graph(graph, manager)\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 2953, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 3051, in process_stale_scc\r\n graph[id].type_check_first_pass()\r\n File \"/usr/lib/python3.9/site-packages/mypy/build.py\", line 2111, in type_check_first_pass\r\n self.type_checker().check_first_pass()\r\n File \"/usr/lib/python3.9/site-packages/mypy/checker.py\", line 294, in check_first_pass\r\n self.accept(d)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checker.py\", line 401, in accept\r\n stmt.accept(self)\r\n File \"/usr/lib/python3.9/site-packages/mypy/nodes.py\", line 1130, in accept\r\n return visitor.visit_for_stmt(self)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checker.py\", line 3479, in visit_for_stmt\r\n iterator_type, item_type = self.analyze_iterable_item_type(s.expr)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checker.py\", line 3499, in analyze_iterable_item_type\r\n iterator = echk.check_method_call_by_name('__iter__', iterable, [], [], expr)[0]\r\n File \"/usr/lib/python3.9/site-packages/mypy/checkexpr.py\", line 2345, in check_method_call_by_name\r\n method_type = analyze_member_access(method, base_type, context, False, False, True,\r\n File \"/usr/lib/python3.9/site-packages/mypy/checkmember.py\", line 126, in analyze_member_access\r\n result = _analyze_member_access(name, typ, mx, override_info)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checkmember.py\", line 155, in _analyze_member_access\r\n return _analyze_member_access(name, tuple_fallback(typ), mx, override_info)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checkmember.py\", line 143, in _analyze_member_access\r\n return analyze_instance_member_access(name, typ, mx, override_info)\r\n File \"/usr/lib/python3.9/site-packages/mypy/checkmember.py\", line 215, in analyze_instance_member_access\r\n dispatched_type = meet.meet_types(mx.original_type, typ)\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 50, in meet_types\r\n return t.accept(TypeMeetVisitor(s))\r\n File \"/usr/lib/python3.9/site-packages/mypy/types.py\", line 794, in accept\r\n return visitor.visit_instance(self)\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 526, in visit_instance\r\n return meet_types(t, self.s)\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 50, in meet_types\r\n return t.accept(TypeMeetVisitor(s))\r\n File \"/usr/lib/python3.9/site-packages/mypy/types.py\", line 1347, in accept\r\n return visitor.visit_tuple_type(self)\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 588, in visit_tuple_type\r\n return t.copy_modified(items=[meet_types(it, self.s.args[0]) for it in t.items])\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 588, in \u003clistcomp>\r\n return t.copy_modified(items=[meet_types(it, self.s.args[0]) for it in t.items])\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 50, in meet_types\r\n return t.accept(TypeMeetVisitor(s))\r\n File \"/usr/lib/python3.9/site-packages/mypy/types.py\", line 1098, in accept\r\n return visitor.visit_callable_type(self)\r\n File \"/usr/lib/python3.9/site-packages/mypy/meet.py\", line 540, in visit_callable_type\r\n if not ((t.is_type_obj() and t.type_object().is_abstract) or\r\n File \"/usr/lib/python3.9/site-packages/mypy/types.py\", line 1094, in type_object\r\n assert isinstance(ret, Instance)\r\nAssertionError:\r\nbug.py:34: : note: use --pdb to drop into pdb\r\n```\r\n\r\n**To Reproduce**\r\n\r\n```pyhton\r\nimport abc\r\n\r\n\r\nclass IClass(metaclass=abc.ABCMeta):\r\n \"\"\"Base class\"\"\"\r\n\r\n\r\nclass A(IClass):\r\n def __init__(self, el: str, a: IClass) -> None:\r\n self._el = el\r\n self._a = a\r\n\r\n\r\nclass B(IClass):\r\n def __init__(self, b: float) -> None:\r\n self._b = b\r\n\r\n\r\ndef C(b):\r\n return A('-', B(b))\r\n\r\n\r\nclass D(IClass):\r\n def __init__(self, b: float) -> None:\r\n self._b = b\r\n\r\n\r\nbuilders = (\r\n C,\r\n D,\r\n)\r\n\r\n\r\nfor builder in builders:\r\n pass\r\n```\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 0.790\r\n- Mypy command-line flags: None\r\n- Mypy configuration options from `mypy.ini` (and other config files): default\r\n- Python version used: 3.6 and 3.9\r\n- Operating system and version: ArchLinux\r\n\r\n\u003c!--\r\nYou can freely edit this text, please remove all the lines\r\nyou believe are unnecessary.\r\n-->\r\n","author":{"url":"https://github.com/idrissbellil","@type":"Person","name":"idrissbellil"},"datePublished":"2020-12-26T18:07:52Z","url":"https://github.com/python/mypy/issues/9838"}
| 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:9be63a62-c692-ee12-7769-2a813a6afc6a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 959E:1B0A31:2164268:2D694B3:6B002533 |
| html-safe-nonce | 5f495b1ca401756c3b5da3d7d4049a16f9d0c9fce0b43aa6a81a096b405f78d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTlFOjFCMEEzMToyMTY0MjY4OjJENjk0QjM6NkIwMDI1MzMiLCJ2aXNpdG9yX2lkIjoiOTEwNTIwNzgxNjA3MDYzNjg1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a6b8cd2958af19c09aebf01e4a22572ce08f4a7eadbaf552f6081bd11de87c65 |
| hovercard-subject-tag | issue:774912643 |
| 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/9838/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e21c461a8e91b38c637304af730f0c1b856f8d495fe34202765e464afcb386be/python/mypy/issues/9838 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e21c461a8e91b38c637304af730f0c1b856f8d495fe34202765e464afcb386be/python/mypy/issues/9838 |
| og:image:alt | Crash Report Mypy crashed, the code snippet below is enough to reproduce that. Traceback bug.py:34: error: INTERNAL ERROR -- Please try using mypy master on Github: https://mypy.rtfd.io/en/latest/c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | idrissbellil |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width