typing
typing copied to clipboard
(🎁) Allow usage of `TypedDict` as a type, such that it can be used in the `bound` of a `TypeVar`
from typing import TypedDict, Unpack
class A[ExtraArgs: TypedDict]:
def do_it(self, **extra: Unpack[ExtraArgs]): ...
class Thing(TypedDict):
t: int
A[Thing]().do_it(
t=1, # no error
imposter="sus", # yes error
)