Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mypy/plugins/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def transform(self) -> bool:
and (
"__match_args__" not in info.names or info.names["__match_args__"].plugin_generated
)
and attributes
and py_version >= (3, 10)
):
str_type = self._api.named_type("builtins.str")
Expand Down
5 changes: 5 additions & 0 deletions test-data/unit/check-dataclasses.test
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,11 @@ class Two:
bar: int
t: Two
reveal_type(t.__match_args__) # N: Revealed type is "Tuple[Literal['bar']]"
@dataclass
class Empty:
...
e: Empty
reveal_type(e.__match_args__) # N: Revealed type is "Tuple[]"
[builtins fixtures/dataclasses.pyi]

[case testDataclassWithoutMatchArgs]
Expand Down