8000 Fix type argument inference for overloaded functions with explicit self types (Fixes #14943). by tyralla · Pull Request #14975 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix type argument inference for overloaded functions with explicit self types (Fixes #14943). #14975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Prev Previous commit
Next Next commit
black
  • Loading branch information
tyralla committed Apr 10, 2023
commit 9c107b30fc6aeae4ef34cc213896518a2edf49ea
5 changes: 4 additions & 1 deletion mypy/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ def _is_subtype(
# ErasedType as we do for non-proper subtyping.
return True

if subtype_context.ignore_type_vars and (isinstance(left, TypeVarType) or isinstance(right, TypeVarType)):

if subtype_context.ignore_type_vars and (
isinstance(left, TypeVarType) or isinstance(right, TypeVarType)
):
return True

if isinstance(right, UnionType) and not isinstance(left, UnionType):
Expand Down
0