GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Mypy crashes on async tuple to tuple assignment · Issue #19920 · python/mypy Labels DescriptionCrash Report We got a tuple to tuple assignment with asyncio.gather, which crashes mypy, it looks like this: tab_content: PriceCombinedDBAccessTabContentDto price_region_stats: PriceRegionStats ( # < Error points to this line, this is line 70 price_data, tab_content, all_price_regions, all_prof_role_groups, price_region_stats, has_civ_service, ) = await asyncio.gather( get_price_data(handler, TabName.COMBINED_DBACCESS, price_description, backoffice_employer_id, session), get_price_tab_content(http_client, config, TabName.COMBINED_DBACCESS, backoffice_employer_id), get_all_price_regions(handler), get_all_prof_role_groups(handler), get_price_regions_stats(http_client, config), check_employer_has_service_no_handler( http_client, config, employer_id_or_backoffice_employer_id, ProductItemCode.ContactsView ), ) Traceback xhh/pages/price/combined_dbaccess.py:70: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build Please report a bug at https://github.com/python/mypy/issues version: 1.19.0+dev.354bea6352ee7a38b05e2f42c874e7d1f7bf557a Traceback (most recent call last): File "/Users/gooverdian/Projects/xhh/.venv/bin/mypy", line 8, in <module> sys.exit(console_entry()) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry main() File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/main.py", line 127, in main res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/main.py", line 211, in run_build res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 196, in build result = _build( File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 272, in _build graph = dispatch(sources, manager, stdout) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 2946, in dispatch process_graph(graph, manager) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 3346, in process_graph process_stale_scc(graph, scc, manager) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 3447, in process_stale_scc graph[id].type_check_first_pass() File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/build.py", line 2325, in type_check_first_pass self.type_checker().check_first_pass() File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 524, in check_first_pass self.accept(d) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 635, in accept stmt.accept(self) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1127, in accept return visitor.visit_decorator(self) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 5412, in visit_decorator self.visit_decorator_inner(e) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 5419, in visit_decorator_inner self.check_func_item(e.func, name=e.func.name, allow_empty=allow_empty) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 1231, in check_func_item self.check_func_def(defn, typ, name, allow_empty) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 1504, in check_func_def self.accept(item.body) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 635, in accept stmt.accept(self) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1542, in accept return visitor.visit_block(self) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 3126, in visit_block self.accept(s) File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 635, in accept stmt.accept(self) ~~~~~~~~~~~^^^^^^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1629, in accept return visitor.visit_assignment_stmt(self) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 3177, in visit_assignment_stmt self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 3233, in check_assignment self.check_assignment_to_multiple_lvalues( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ lvalue.items, rvalue, rvalue, infer_lvalue_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 3984, in check_assignment_to_multiple_lvalues self.check_multi_assignment(lvalues, rvalue, context, infer_lvalue_type) ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 4062, in check_multi_assignment self.check_multi_assignment_from_tuple( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ lvalues, rvalue, rvalue_type, context, undefined_rvalue, infer_lvalue_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/Users/gooverdian/Projects/xhh/.venv/lib/python3.13/site-packages/mypy/checker.py", line 4202, in check_multi_assignment_from_tuple assert isinstance(reinferred_rvalue_type, TupleType) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: To Reproduce This file is not new, so the diff, which lead to that error is adding types to some members of a left tuple before the assignment: + tab_content: PriceCombinedDBAccessTabContentDto + price_region_stats: PriceRegionStats ( price_data, tab_content, all_price_regions, all_prof_role_groups, price_region_stats, has_civ_service, ) = await asyncio.gather( get_price_data(handler, TabName.COMBINED_DBACCESS, price_description, backoffice_employer_id, session), get_price_tab_content(http_client, config, TabName.COMBINED_DBACCESS, backoffice_employer_id), get_all_price_regions(handler), get_all_prof_role_groups(handler), get_price_regions_stats(http_client, config), check_employer_has_service_no_handler( http_client, config, employer_id_or_backoffice_employer_id, ProductItemCode.ContactsView ), ) UPD: Found a way to reproduce it in playground https://mypy-play.net/?mypy=latest&python=3.13&gist=ca818b7f434ca646dd6373b26f5b58f6, seems like there would be an error if it wouldn't crash. Your Environment
Reacted by lcy Activity
MetadataMetadataAssigneesLabelsProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |