Skip to content

Commit 8c0260e

Browse files
committed
Consider CallableType.deprecated in __hash__, __eq__, serialize, and deserialize.
1 parent 286371f commit 8c0260e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mypy/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,7 @@ def __hash__(self) -> int:
22022202
tuple(self.arg_names),
22032203
tuple(self.arg_kinds),
22042204
self.fallback,
2205+
self.deprecated,
22052206
)
22062207
)
22072208

@@ -2216,6 +2217,7 @@ def __eq__(self, other: object) -> bool:
22162217
and self.is_type_obj() == other.is_type_obj()
22172218
and self.is_ellipsis_args == other.is_ellipsis_args
22182219
and self.fallback == other.fallback
2220+
and self.deprecated == other.deprecated
22192221
)
22202222
else:
22212223
return NotImplemented
@@ -2242,6 +2244,7 @@ def serialize(self) -> JsonDict:
22422244
"from_concatenate": self.from_concatenate,
22432245
"imprecise_arg_kinds": self.imprecise_arg_kinds,
22442246
"unpack_kwargs": self.unpack_kwargs,
2247+
"deprecated": self.deprecated,
22452248
}
22462249

22472250
@classmethod
@@ -2267,6 +2270,7 @@ def deserialize(cls, data: JsonDict) -> CallableType:
22672270
from_concatenate=data["from_concatenate"],
22682271
imprecise_arg_kinds=data["imprecise_arg_kinds"],
22692272
unpack_kwargs=data["unpack_kwargs"],
2273+
deprecated=data["deprecated"],
22702274
)
22712275

22722276

0 commit comments

Comments
 (0)