Difference between TypeVar('T', A, B) and TypeVar('T', bound=Union[A, B])
What's the difference between the following two TypeVar s? from typing import TypeVar, Union class A: pass class B: pass T = TypeVar("T", A, B) T = TypeVar("T", bound=Union[A, B]) I believe that in Python 3.12 this is the difference between these two bounds class Foo[T: (A, B)]: ... class Foo[T: A | B]: ... Here's an example of something I don't get: this pa