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 — IndexError when unpacking type · Issue #20913 · python/mypy Closed Labels DescriptionCrash Report The snippet below crashes mypy 1.19.1 and master (f363f35). Traceback Traceback (most recent call last): File ".venv-mypy/bin/mypy", line 6, in <module> sys.exit(console_entry()) File "mypy/mypy/__main__.py", line 15, in console_entry main() File "mypy/mypy/main.py", line 130, in main res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr) File "mypy/mypy/main.py", line 214, in run_build res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr) File "mypy/mypy/build.py", line 378, in build result = build_inner( File "mypy/mypy/build.py", line 478, in build_inner graph = dispatch(sources, manager, stdout) File "mypy/mypy/build.py", line 3652, in dispatch process_graph(graph, manager) File "mypy/mypy/build.py", line 4105, in process_graph done, still_working, results = manager.wait_for_done(graph) File "mypy/mypy/build.py", line 1173, in wait_for_done process_stale_scc(graph, next_scc, self) File "mypy/mypy/build.py", line 4268, in process_stale_scc mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors) File "mypy/mypy/semanal_main.py", line 92, in semantic_analysis_for_scc process_top_levels(graph, scc, patches) File "mypy/mypy/semanal_main.py", line 230, in process_top_levels deferred, incomplete, progress = semantic_analyze_target( File "mypy/mypy/semanal_main.py", line 407, in semantic_analyze_target analyzer.refresh_partial( File "mypy/mypy/semanal.py", line 701, in refresh_partial self.refresh_top_level(node) File "mypy/mypy/semanal.py", line 719, in refresh_top_level self.accept(d) File "mypy/mypy/semanal.py", line 7627, in accept node.accept(self) ~~~~~~~~~~~^^^^^^ File "mypy/mypy/nodes.py", line 1752, in accept return visitor.visit_assignment_stmt(self) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/semanal.py", line 3345, in visit_assignment_stmt self.process_type_annotation(s) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ File "mypy/mypy/semanal.py", line 3883, in process_type_annotation if analyzed is None or has_placeholder(analyzed): ~~~~~~~~~~~~~~~^^^^^^^^^^ File "mypy/mypy/semanal_shared.py", line 377, in has_placeholder return typ.accept(HasPlaceholders()) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "mypy/mypy/types.py", line 418, in accept return visitor.visit_type_alias_type(self) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/type_visitor.py", line 598, in visit_type_alias_type return get_proper_type(t).accept(self) ~~~~~~~~~~~~~~~^^^ File "mypy/mypy/types.py", line 3648, in get_proper_type typ = typ._expand_once() File "mypy/mypy/types.py", line 382, in _expand_once return self.alias.target.accept(InstantiateAliasVisitor(mapping)) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "mypy/mypy/types.py", line 1672, in accept return visitor.visit_instance(self) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/expandtype.py", line 215, in visit_instance args = self.expand_type_tuple_with_unpack(t.args) File "mypy/mypy/expandtype.py", line 533, in expand_type_tuple_with_unpack items.append(item.accept(self)) ~~~~~~~~~~~^^^^^^ File "mypy/mypy/types.py", line 1236, in accept return visitor.visit_unpack_type(self) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/expandtype.py", line 387, in visit_unpack_type return UnpackType(t.type.accept(self)) ~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/types.py", line 1672, in accept return visitor.visit_instance(self) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "mypy/mypy/expandtype.py", line 228, in visit_instance arg = args[0] ~~~~^^^ IndexError: list index out of range To Reproduce from typing import Unpack class C[*Ts]: pass type T[T, *Ts] = C[*Ts] x: T[bool, Unpack[tuple[()]]] Your Environment
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. |