Python 3.12 introduced new syntax sugar for generics. What's the new way of writing an upper-bounded generic like this:
def foo[T extends Bar](baz: T) -> T:
...
Before new syntax features I believe you could write
from typing import Generic, TypeVar
T = TypeVar("T", bound=Bar)
def foo(baz: T) -> T:
...