8000 Mark protocol members as abstract · python/cpython@1e1ea41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e1ea41

Browse files
committed
Mark protocol members as abstract
1 parent 4d50c2e commit 1e1ea41

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/typing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,13 +2936,15 @@ class Reader[T](Iterable[T], Protocol):
29362936

29372937
__slots__ = ()
29382938

2939+
@abstractmethod
29392940
def read(self, size: int = ..., /) -> T:
29402941
"""Read data from the input stream and return it.
29412942
29422943
If "size" is specified, at most "size" items (bytes/characters) will be
29432944
read.
29442945
"""
29452946

2947+
@abstractmethod
29462948
def readline(self, size: int = ..., /) -> T:
29472949
"""Read a line of data from the input stream and return it.
29482950
@@ -2960,6 +2962,7 @@ class Writer[T](Protocol):
29602962

29612963
__slots__ = ()
29622964

2965+
@abstractmethod
29632966
def write(self, data: T, /) -> int:
29642967
"""Write data to the output stream and return number of items written."""
29652968

0 commit comments

Comments
 (0)
0