gh-104549: Set __module__ on TypeAliasType (#104550)

This commit is contained in:
Jelle Zijlstra 2023-05-18 15:56:15 -07:00 committed by GitHub
parent 1c55e8d007
commit b9dce3aec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 93 additions and 34 deletions

View file

@ -1,6 +1,6 @@
"""Module for testing the behavior of generics across different modules."""
from typing import TypeVar, Generic, Optional
from typing import TypeVar, Generic, Optional, TypeAliasType
default_a: Optional['A'] = None
default_b: Optional['B'] = None
@ -19,3 +19,6 @@ class B(Generic[T]):
my_inner_a1: 'B.A'
my_inner_a2: A
my_outer_a: 'A' # unless somebody calls get_type_hints with localns=B.__dict__
type Alias = int
OldStyle = TypeAliasType("OldStyle", int)