Bug Report
Not a big deal, but mypy appears to generate __match_args__ for dataclasses and NamedTuples even when running with --python-version set to 3.9:
fromdataclassesimportdataclassfromtypingimportNamedTuple@dataclassclassOne:
bar: intf: Onereveal_type(f.__match_args__) # Revealed type is "Tuple[Literal['bar']]"classTwo(NamedTuple):
baz: strg: Tworeveal_type(g.__match_args__) # Revealed type is "Tuple[Literal['baz']]"
Expected Behavior
Mypy should not autogenerate __match_args__ when running with --python-version set to <3.10, as pattern-matching is new in 3.10.
Your Environment
- Mypy version used:
0.950+dev.a33d2353a81d075850a487f3913720037f2473aa (compiled: no) - Mypy command-line flags:
--python-version 3.9 - Mypy configuration options from
mypy.ini (and other config files): None - Python version used: 3.10
- Operating system and version: Windows
Bug Report
Not a big deal, but mypy appears to generate
__match_args__for dataclasses andNamedTuples even when running with--python-versionset to 3.9:Expected Behavior
Mypy should not autogenerate
__match_args__when running with--python-versionset to <3.10, as pattern-matching is new in 3.10.Your Environment
0.950+dev.a33d2353a81d075850a487f3913720037f2473aa (compiled: no)--python-version 3.9mypy.ini(and other config files): None