@@ -672,7 +672,7 @@ Protocols are essentially anonymous. To emphasize this point, static type
672
672
checkers might refuse protocol classes inside ``NewType()`` to avoid an
673
673
illusion that a distinct type is provided::
674
674
675
- form typing import NewType , Protocol, Iterator
675
+ from typing import NewType, Protocol, Iterator
676
676
677
677
class Id(Protocol):
678
678
code: int
@@ -731,7 +731,7 @@ with PEP 484. Examples::
731
731
732
732
def process(items: Iterable[int]) -> None:
733
733
if isinstance(items, Iterator):
734
- # 'items' have type 'Iterator[int]' here
734
+ # 'items' has type 'Iterator[int]' here
735
735
elif isinstance(items, Sequence[int]):
736
736
# Error! Can't use 'isinstance()' with subscripted protocols
737
737
@@ -864,7 +864,8 @@ reasons:
864
864
which won't happen.
865
865
* Protocol classes should generally not have many method implementations,
866
866
as they describe an interface, not an implementation.
867
- Most classes have many implementations, making them bad protocol classes.
867
+ Most classes have many method implementations, making them bad protocol
868
+ classes.
868
869
* Experience suggests that many classes are not practical as protocols anyway,
869
870
mainly because their interfaces are too large, complex or
870
871
implementation-oriented (for example, they may include de facto
0 commit comments