mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
gh-104549: Set __module__ on TypeAliasType (#104550)
This commit is contained in:
parent
1c55e8d007
commit
b9dce3aec4
9 changed files with 93 additions and 34 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue