Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3k
Open
Description
fromtypingimportAny,Callable,Protocol,runtime_checkableclassProto(Protocol):deffoo(self,x:int,/)->object: ...deftest_object(x:object)->None:matchx:caseProto()asy:# No Errorreveal_type(y)# N: Revealed type is "__main__.Proto"ifisinstance(x,Proto):# E: Only @runtime_checkable protocols ...reveal_type(x)# N: Revealed type is "__main__.Proto"
https://mypy-play.net/?mypy=latest&python=3.12&gist=6e3f280e71d3cb4d6131e51496370f97