Introduce a `typing.NoBound`

class A[T1, T2: None=None]:
    print(T1.__bound__, T1.__default__)  # None, typing.NoDefault 
    print(T2.__bound__, T2.__default__)  # None, None

to mirror the default of default, we should introduce a NoBound

It was decided to not do anything here: `typing.TypeVar` doesn't distinguish between `(bound=None)` and not providing a `bound` argument · Issue #129543 · python/cpython · GitHub.

2 Likes