diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index 2803da0a..a7370b36 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -502,15 +502,18 @@ For example:: from typing import Any, Protocol class ProtoA(Protocol): - def meth(self, x: int) -> int: ... + def meth(self, x: int) -> int: + ... class ProtoB(Protocol): - def meth(self, obj: Any, x: int) -> int: ... + def meth(self, obj: Any, x: int) -> int: + ... class C: - def meth(self, x: int) -> int: ... + def meth(self, x: int) -> int: + ... - a: ProtoA = C # Type check error, signatures don't match! - b: ProtoB = C # OK + a: ProtoA = C() # OK + b: ProtoB = C() # Error: signatures don't match .. _`protocol-newtype-aliases`: