Skip to content

Commit

Permalink
Add another comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevkivskyi committed Jul 23, 2023
1 parent 9dd613d commit 49d5415
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypy/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,9 @@ def visit_callable_type(self, template: CallableType) -> list[Constraint]:
# depends on this old behaviour.
and not any(tv.id.raw_id == 0 for tv in cactual.variables)
):
# If the actual callable is generic, infer constraints in the opposite
# direction, and indicate to the solver there are extra type variables
# to solve for (see more details in mypy/solve.py).
res.extend(
infer_constraints(
cactual, template, neg_op(self.direction), skip_neg_op=True
Expand Down

0 comments on commit 49d5415

Please sign in to comment.