Skip to content

Commit 34dbbfa

Browse files
authored
Remove special handling of kw_only in dataclass plugin serialization
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.
1 parent c918d40 commit 34dbbfa

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

mypy/plugins/dataclasses.py

-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ def deserialize(
158158
cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface
159159
) -> DataclassAttribute:
160160
data = data.copy()
161-
if data.get("kw_only") is None:
162-
data["kw_only"] = False
163161
typ = deserialize_and_fixup_type(data.pop("type"), api)
164162
return cls(type=typ, info=info, **data)
165163

0 commit comments

Comments
 (0)