File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 4747 AnyType ,
4848 DeletedType ,
4949 Instance ,
50+ ParamSpecType ,
5051 ProperType ,
5152 TupleType ,
5253 Type ,
@@ -970,6 +971,12 @@ def get_dict_base_type(self, expr: Expression) -> list[Instance]:
970971 t = t .fallback
971972 dict_base = next (base for base in t .type .mro if base .fullname == "typing.Mapping" )
972973 else :
974+ if isinstance (t , ParamSpecType ):
975+ # Since `ParamSpec(upper_bound=...)` is not defined yet, we know that
976+ # `bound` is set to `dict[str, object]`. In any future sane implementation
977+ # it still has to be exactly a `dict` as that's how kwargs work
978+ # at runtime.
979+ t = get_proper_type (t .upper_bound )
973980 assert isinstance (t , Instance ), t
974981 dict_base = next (base for base in t .type .mro if base .fullname == "builtins.dict" )
975982 dict_types .append (map_instance_to_supertype (t , dict_base ))
You can’t perform that action at this time.
0 commit comments