@@ -7439,34 +7439,6 @@ def test_wrong_amount_of_parameters(self):
74397439 self .assertEqual (get_args (alias ), expected_args )
74407440 self .assertEqual (alias .__parameters__ , expected_params )
74417441
7442- def test_list_argument (self ):
7443- # NOTE: These cases could be seen as valid but result in a parameterless
7444- # variable. If these tests fail the specificiation might have changed
7445-
7446- # Callable
7447- P = ParamSpec ('P' )
7448- CallableP = TypeAliasType ("CallableP" , Callable [P , Any ], type_params = (P ,))
7449- CallableT_list = CallableP [[T ]]
7450- self .assertEqual (get_args (CallableT_list ), ([T ],))
7451- self .assertEqual (CallableT_list .__parameters__ , ())
7452- with self .assertRaises (TypeError , msg = "is not a generic class" ):
7453- CallableT_list [str ]
7454-
7455- ImplicitConcatP = CallableP [[int , P ]]
7456- self .assertEqual (get_args (ImplicitConcatP ), ([int , P ],))
7457- self .assertEqual (ImplicitConcatP .__parameters__ , ())
7458- with self .assertRaises (TypeError , msg = "is not a generic class" ):
7459- ImplicitConcatP [str ]
7460-
7461- # TypeVarTuple
7462- Ts = TypeVarTuple ("Ts" )
7463- Variadic = TypeAliasType ("Variadic" , Tuple [int , Unpack [Ts ]], type_params = (Ts ,))
7464- invalid_tupleT = Variadic [[int , T ]]
7465- self .assertEqual (get_args (invalid_tupleT ), ([int , T ],))
7466- self .assertEqual (invalid_tupleT .__parameters__ , ())
7467- with self .assertRaises (TypeError , msg = "is not a generic class" ):
7468- invalid_tupleT [str ]
7469-
74707442 # The condition should align with the version of GeneriAlias usage in __getitem__
74717443 @skipIf (TYPING_3_10_0 , "Most cases are allowed in 3.11+ or with GenericAlias" )
74727444 def test_invalid_cases_before_3_11 (self ):
0 commit comments