mypy crashes when it attempts to parse a match-statement with a subject expression that consists of a tuple with an unpacked secondary tuple inside.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "mypy/checker.py", line 765, in accept
File "mypy/nodes.py", line 2209, in accept
File "mypy/checker.py", line 5968, in visit_match_stmt
File "mypy/checker.py", line 6036, in _get_recursive_sub_patterns_map
AssertionError
main.py:3: 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: 2.0.0
main.py:3: note: use --pdb to drop into pdb
Crash Report
mypy crashes when it attempts to parse a match-statement with a subject expression that consists of a tuple with an unpacked secondary tuple inside.
See the mypy playground link:
https://mypy-play.net/?mypy=latest&python=3.14&flags=show-traceback&gist=e9fee1e1ecabfc2fc0aa5fc7a326f24c
Your Environment
mypy.ini(and other config files): none