basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Support `NotRequired` on classes

Open KotlinIsland opened this issue 1 year ago • 1 comments

To make an iterable that doesn't support str:

class WorkProperlyIterable(Iterable[out_T], Protocol):
    __contains__: NotRequired["(object) -> bool"]

KotlinIsland avatar Jun 25 '24 01:06 KotlinIsland

And introduce a:

type Banned = NotRequired[Never]

in basedtyping

KotlinIsland avatar Jun 25 '24 02:06 KotlinIsland