Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Jelle's wording
  • Loading branch information
hamdanal committed Feb 21, 2024
commit 5d1da8becb89d9a092267dd7e9bc167cf8a86359
2 changes: 1 addition & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3829,7 +3829,7 @@ def analyze_type_alias_type_params(self, rvalue: CallExpr) -> TypeVarLikeList:
if isinstance(tvar[1], TypeVarTupleExpr):
if have_type_var_tuple:
self.fail(
"Can only use one type var tuple in type_params argument to TypeAliasType",
"Can only use one TypeVarTuple in type_params argument to TypeAliasType",
base,
code=codes.TYPE_VAR,
)
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-type-aliases.test
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ partially_generic1: Ta3[int] = {"a": 1}
reveal_type(partially_generic1) # N: Revealed type is "builtins.dict[Any, builtins.int]"
partially_generic2: Ta3[int] = {1: "a"} # E: Dict entry 0 has incompatible type "int": "str"; expected "Any": "int"

Ta4 = TypeAliasType("Ta4", Tuple[Unpack[Ts]], type_params=(Ts, Ts1)) # E: Can only use one type var tuple in type_params argument to TypeAliasType
Ta4 = TypeAliasType("Ta4", Tuple[Unpack[Ts]], type_params=(Ts, Ts1)) # E: Can only use one TypeVarTuple in type_params argument to TypeAliasType

Ta5 = TypeAliasType("Ta5", Dict) # Unlike old style aliases, this is not generic
Comment thread
JelleZijlstra marked this conversation as resolved.
non_generic_dict: Ta5[int, str] # E: Bad number of arguments for type alias, expected 0, given 2
Expand Down