Skip to content

Commit

Permalink
Suppress wrong type arg count message before TypeVar defaults are app…
Browse files Browse the repository at this point in the history
…lied
  • Loading branch information
cdce8p committed Jan 23, 2024
1 parent 78df009 commit 5085122
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mypy/typeanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,12 +2284,7 @@ def validate_instance(t: Instance, fail: MsgCallback, empty_tuple_index: bool) -
return False
elif len(t.args) != len(t.type.type_vars):
# Invalid number of type parameters.
if t.args:
fail(
wrong_type_arg_count(len(t.type.type_vars), str(len(t.args)), t.type.name),
t,
code=codes.TYPE_ARG,
)
# Emitted by fix_instance after TypeVar defaults are filled
return False
return True

Expand Down

0 comments on commit 5085122

Please sign in to comment.