178178 type_aliases_source_versions ,
179179 typing_extensions_aliases ,
180180)
181- from mypy .options import Options
181+ from mypy .options import TYPE_VAR_TUPLE , Options
182182from mypy .patterns import (
183183 AsPattern ,
184184 ClassPattern ,
@@ -3996,7 +3996,7 @@ def process_typevar_declaration(self, s: AssignmentStmt) -> bool:
39963996 type_var .line = call .line
39973997 call .analyzed = type_var
39983998 updated = True
3999- # self.tvar_scope.bind_new(name, type_var)
3999+ # self.tvar_scope.bind_new(name, type_var) # TODO!
40004000 else :
40014001 assert isinstance (call .analyzed , TypeVarExpr )
40024002 updated = (
@@ -4196,6 +4196,9 @@ def process_paramspec_declaration(self, s: AssignmentStmt) -> bool:
41964196 return False
41974197
41984198 n_values = call .arg_kinds [1 :].count (ARG_POS )
4199+ if n_values != 0 :
4200+ self .fail ("Only the first positional argument to ParamSpec has defined semantics" , s )
4201+
41994202 default : Type = AnyType (TypeOfAny .from_omitted_generics )
42004203 for param_value , param_name , param_kind in zip (
42014204 call .args [1 + n_values :],
@@ -4226,7 +4229,7 @@ def process_paramspec_declaration(self, s: AssignmentStmt) -> bool:
42264229 )
42274230 paramspec_var .line = call .line
42284231 call .analyzed = paramspec_var
4229- self .tvar_scope .bind_new (name , paramspec_var )
4232+ # self.tvar_scope.bind_new(name, paramspec_var) # TODO!
42304233 else :
42314234 assert isinstance (call .analyzed , ParamSpecExpr )
42324235 self .add_symbol (name , call .analyzed , s )
@@ -4244,6 +4247,11 @@ def process_typevartuple_declaration(self, s: AssignmentStmt) -> bool:
42444247 return False
42454248
42464249 n_values = call .arg_kinds [1 :].count (ARG_POS )
4250+ if n_values != 0 :
4251+ self .fail (
4252+ "Only the first positional argument to TypeVarTuple has defined semantics" , s
4253+ )
4254+
42474255 default : Type = AnyType (TypeOfAny .from_omitted_generics )
42484256 for param_value , param_name , param_kind in zip (
42494257 call .args [1 + n_values :],
@@ -4266,8 +4274,8 @@ def process_typevartuple_declaration(self, s: AssignmentStmt) -> bool:
42664274 s ,
42674275 )
42684276
4269- # if not self.incomplete_feature_enabled(TYPE_VAR_TUPLE, s):
4270- # return False
4277+ if not self .incomplete_feature_enabled (TYPE_VAR_TUPLE , s ):
4278+ return False
42714279
42724280 name = self .extract_typevarlike_name (s , call )
42734281 if name is None :
@@ -4286,6 +4294,7 @@ def process_typevartuple_declaration(self, s: AssignmentStmt) -> bool:
42864294 )
42874295 typevartuple_var .line = call .line
42884296 call .analyzed = typevartuple_var
4297+ # self.tvar_scope.bind_new(name, typevartuple_var) # TODO!
42894298 else :
42904299 assert isinstance (call .analyzed , TypeVarTupleExpr )
42914300 self .add_symbol (name , call .analyzed , s )
0 commit comments