From 05d7e7b83f7039749820eef650096a2510a1ae84 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 13 Jan 2024 18:42:18 -0800 Subject: [PATCH] alias --- conformance/tests/generics_scoping.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conformance/tests/generics_scoping.py b/conformance/tests/generics_scoping.py index 1bdefb9dc..7f6923342 100644 --- a/conformance/tests/generics_scoping.py +++ b/conformance/tests/generics_scoping.py @@ -1,6 +1,6 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#scoping-rules-for-type-variables -from typing import TypeVar, Generic, Iterable, assert_type +from typing import TypeVar, Generic, Iterable, TypeAlias, assert_type # > A type variable used in a generic function could be inferred to represent # > different types in the same code block. @@ -77,6 +77,8 @@ class Inner(Iterable[S]): # OK ... attr: Inner[T] # OK + alias: TypeAlias = list[T] # Type error + # Test unbound type variables at global scope global_var1: T # Type error