Skip to content

Commit 7919e59

Browse files
authored
Fix deserialisation of ParamSpecType (#10923)
Co-authored-by: hauntsaninja <>
1 parent 2736edb commit 7919e59

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

mypy/types.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,21 +1252,21 @@ def serialize(self) -> JsonDict:
12521252
def deserialize(cls, data: JsonDict) -> 'CallableType':
12531253
assert data['.class'] == 'CallableType'
12541254
# TODO: Set definition to the containing SymbolNode?
1255-
return CallableType([deserialize_type(t) for t in data['arg_types']],
1256-
[ArgKind(x) for x in data['arg_kinds']],
1257-
data['arg_names'],
1258-
deserialize_type(data['ret_type']),
1259-
Instance.deserialize(data['fallback']),
1260-
name=data['name'],
1261-
variables=[TypeVarType.deserialize(v) for v in data['variables']],
1262-
is_ellipsis_args=data['is_ellipsis_args'],
1263-
implicit=data['implicit'],
1264-
bound_args=[(None if t is None else deserialize_type(t))
1265-
for t in data['bound_args']],
1266-
def_extras=data['def_extras'],
1267-
type_guard=(deserialize_type(data['type_guard'])
1268-
if data['type_guard'] is not None else None),
1269-
)
1255+
return CallableType(
1256+
[deserialize_type(t) for t in data['arg_types']],
1257+
[ArgKind(x) for x in data['arg_kinds']],
1258+
data['arg_names'],
1259+
deserialize_type(data['ret_type']),
1260+
Instance.deserialize(data['fallback']),
1261+
name=data['name'],
1262+
variables=[cast(TypeVarLikeType, deserialize_type(v)) for v in data['variables']],
1263+
is_ellipsis_args=data['is_ellipsis_args'],
1264+
implicit=data['implicit'],
1265+
bound_args=[(None if t is None else deserialize_type(t)) for t in data['bound_args']],
1266+
def_extras=data['def_extras'],
1267+
type_guard=(deserialize_type(data['type_guard'])
1268+
if data['type_guard'] is not None else None),
1269+
)
12701270

12711271

12721272
class Overloaded(FunctionLike):

0 commit comments

Comments
 (0)