We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d9dcb6 commit 0cc75ebCopy full SHA for 0cc75eb
mypy/constraints.py
@@ -251,6 +251,7 @@ def infer_constraints_for_callable(
251
)
252
c = infer_constraints(callee.arg_types[i], actual_type, SUPERTYPE_OF)
253
constraints.extend(c)
254
+
255
if (
256
param_spec
257
and not any(c.type_var == param_spec.id for c in constraints)
@@ -270,6 +271,8 @@ def infer_constraints_for_callable(
270
271
),
272
273
274
275
+ constraints = [c for i, c in enumerate(constraints) if c not in constraints[:i]]
276
if any(isinstance(v, ParamSpecType) for v in callee.variables):
277
# As a perf optimization filter imprecise constraints only when we can have them.
278
constraints = filter_imprecise_kinds(constraints)
0 commit comments