Skip to content

Commit bcd4fef

Browse files
JelleZijlstraRosuav
authored andcommitted
fix typos in PEP 544 (#244)
Fixes a few typos in an example and a confusing phrase.
1 parent 6024eea commit bcd4fef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pep-0544.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ Protocols are essentially anonymous. To emphasize this point, static type
672672
checkers might refuse protocol classes inside ``NewType()`` to avoid an
673673
illusion that a distinct type is provided::
674674

675-
form typing import NewType , Protocol, Iterator
675+
from typing import NewType, Protocol, Iterator
676676

677677
class Id(Protocol):
678678
code: int
@@ -731,7 +731,7 @@ with PEP 484. Examples::
731731

732732
def process(items: Iterable[int]) -> None:
733733
if isinstance(items, Iterator):
734-
# 'items' have type 'Iterator[int]' here
734+
# 'items' has type 'Iterator[int]' here
735735
elif isinstance(items, Sequence[int]):
736736
# Error! Can't use 'isinstance()' with subscripted protocols
737737

@@ -864,7 +864,8 @@ reasons:
864864
which won't happen.
865865
* Protocol classes should generally not have many method implementations,
866866
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.
868869
* Experience suggests that many classes are not practical as protocols anyway,
869870
mainly because their interfaces are too large, complex or
870871
implementation-oriented (for example, they may include de facto

0 commit comments

Comments
 (0)