Currently, instantiating explicit subclasses of protocols with "abstract" attributes is prohibited:
class P(Protocol):
x: int # Note, no r.h.s.
class C(P):
pass
class D(P):
def __init__(self) -> None:
self.x = 42
C() # E: Cannot instantiate abstract class 'C' with abstract attribute 'x'
D() # OK
This is feature appeared with little discussion, in particular should this be specific only to protocols or also to "normal" ABCs?
Currently, instantiating explicit subclasses of protocols with "abstract" attributes is prohibited:
This is feature appeared with little discussion, in particular should this be specific only to protocols or also to "normal" ABCs?