Skip to content

Commit b3497a1

Browse files
committed
Format code in common style in example of protocol implementation for class object
1 parent 243393d commit b3497a1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/spec/protocol.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,15 @@ For example::
502502
from typing import Any, Protocol
503503

504504
class ProtoA(Protocol):
505-
def meth(self, x: int) -> int: ...
505+
def meth(self, x: int) -> int:
506+
...
506507
class ProtoB(Protocol):
507-
def meth(self, obj: Any, x: int) -> int: ...
508+
def meth(self, obj: Any, x: int) -> int:
509+
...
508510

509511
class C:
510-
def meth(self, x: int) -> int: ...
512+
def meth(self, x: int) -> int:
513+
...
511514

512515
a: ProtoA = C() # OK
513516
b: ProtoB = C() # Error: signatures don't match

0 commit comments

Comments
 (0)