Open
Description
Mypy is crashing in this example (currently works with 1.0.9)
Crash Report
mypy --show-error-codes --show-column-numbers --show-traceback example/implementation.py
Deferral trace:
example.implementation:-1
example.implementation:-1
example.implementation:-1
example.implementation:-1
<snip>
example.implementation:-1
To Reproduce
file to repro
from typing import NamedTuple
class CodecKey(NamedTuple):
"""A key object combines type and version."""
@staticmethod
def from_key_str(key: str) -> "CodecKey":
"""Return a CodecKey parsed from a key string.
A codec key string has a format of f"{type_keytag}/{version}"
"""
type_keytag, version = key.split("/")
return CodecKey(type_keytag, version)
Your Environment
- Mypy version used: 1.13
- Mypy command-line flags:
--show-traceback
- Mypy configuration options from
mypy.ini
[mypy]
[mypy-importlib.*]
follow_imports = skip
follow_imports_for_stubs = True
- Python version used: 3.10.7
- Operating system and version: ubuntu 20.04