-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
The following gives an error in Pyright and I think it should give an error in MyPy as well:
from typing import Protocol
class Foo(Protocol):
...
Foo()https://mypy-play.net/?mypy=latest&python=3.10&gist=f4ca0ee490d9e8b3a117ee785b7bdaf6
I think that even if the protocol class implements an __init__ method, this should still be disallowed:
from typing import Protocol
class Foo(Protocol):
def __init__(self) -> None: pass
Foo() # disallowed
class ConcreteFoo(Foo):
...
ConcreteFoo() # allowed