1"""Module for testing the behavior of generics across different modules.""" 2 3from typing import TypeVar, Generic, Optional 4 5default_a: Optional['A'] = None 6default_b: Optional['B'] = None 7 8T = TypeVar('T') 9 10 11class A(Generic[T]): 12 some_b: 'B' 13 14 15class B(Generic[T]): 16 class A(Generic[T]): 17 pass 18 19 my_inner_a1: 'B.A' 20 my_inner_a2: A 21 my_outer_a: 'A' # unless somebody calls get_type_hints with localns=B.__dict__ 22