We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__match_args__
1 parent 6bdcc92 commit d2022a0Copy full SHA for d2022a0
mypy/plugins/dataclasses.py
@@ -365,7 +365,6 @@ def transform(self) -> bool:
365
and (
366
"__match_args__" not in info.names or info.names["__match_args__"].plugin_generated
367
)
368
- and attributes
369
and py_version >= (3, 10)
370
):
371
str_type = self._api.named_type("builtins.str")
test-data/unit/check-dataclasses.test
@@ -1892,6 +1892,11 @@ class Two:
1892
bar: int
1893
t: Two
1894
reveal_type(t.__match_args__) # N: Revealed type is "Tuple[Literal['bar']]"
1895
+@dataclass
1896
+class Empty:
1897
+ ...
1898
+e: Empty
1899
+reveal_type(e.__match_args__) # N: Revealed type is "Tuple[]"
1900
[builtins fixtures/dataclasses.pyi]
1901
1902
[case testDataclassWithoutMatchArgs]
0 commit comments