Say I have two types (one of them generic) like this
from typing import Generic, TypeVar
T = TypeVar('T')
class A(Generic[T]): pass
class B: pass
And a union of A and B like this
C = A|B
Or, in pre-Python-3.10/PEP 604-syntax:
C = Union[A,B]
How do I have to change the definition of C, so that C is also generic? e.g. if an object is of type C[int], it is either
- of type
A[int](type parameter is passed down) or - of type
B(type parameter is ignored)