typing icon indicating copy to clipboard operation
typing copied to clipboard

(🎁) Allow usage of `TypedDict` as a type, such that it can be used in the `bound` of a `TypeVar`

Open KotlinIsland opened this issue 2 years ago • 0 comments

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
)

KotlinIsland avatar Apr 28 '23 04:04 KotlinIsland