Code: Select all
def foo[T extends Bar](baz: T) -> T:
...
Code: Select all
from typing import Generic, TypeVar
T = TypeVar("T", bound=Bar)
def foo(baz: Generic[T]) -> T:
...
Code: Select all
def foo[T extends Bar](baz: T) -> T:
...
Code: Select all
from typing import Generic, TypeVar
T = TypeVar("T", bound=Bar)
def foo(baz: Generic[T]) -> T:
...