Skip to content

Commit

Permalink
Remove special handling of kw_only in dataclass plugin serialization
Browse files Browse the repository at this point in the history
It is not needed, because it is always serialized as `bool` and is always present.

It was added a long time ago in #10867 as a compat layer. But, since then we've added at least one `is_neither_frozen_nor_nonfrozen` attribute that is serialized / deserialized in a common way.

So, let's remove this hack for good.
  • Loading branch information
sobolevn authored Jun 23, 2023
1 parent c918d40 commit 34dbbfa
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mypy/plugins/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ def deserialize(
cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface
) -> DataclassAttribute:
data = data.copy()
if data.get("kw_only") is None:
data["kw_only"] = False
typ = deserialize_and_fixup_type(data.pop("type"), api)
return cls(type=typ, info=info, **data)

Expand Down

0 comments on commit 34dbbfa

Please sign in to comment.