Skip to content

Commit 9204af4

Browse files
committed
asyncio: Use Interface instead of ABC. Fixes issue 19726.
1 parent 7c63c85 commit 9204af4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Lib/asyncio/events.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def connect_read_pipe(self, protocol_factory, pipe):
234234
protocol_factory should instantiate object with Protocol interface.
235235
pipe is file-like object already switched to nonblocking.
236236
Return pair (transport, protocol), where transport support
237-
ReadTransport ABC"""
237+
ReadTransport interface."""
238238
# The reason to accept file-like object instead of just file descriptor
239239
# is: we need to own pipe and close it at transport finishing
240240
# Can got complicated errors if pass f.fileno(),
@@ -247,7 +247,7 @@ def connect_write_pipe(self, protocol_factory, pipe):
247247
protocol_factory should instantiate object with BaseProtocol interface.
248248
Pipe is file-like object already switched to nonblocking.
249249
Return pair (transport, protocol), where transport support
250-
WriteTransport ABC"""
250+
WriteTransport interface."""
251251
# The reason to accept file-like object instead of just file descriptor
252252
# is: we need to own pipe and close it at transport finishing
253253
# Can got complicated errors if pass f.fileno(),

Lib/asyncio/protocols.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class BaseProtocol:
7-
"""ABC for base protocol class.
7+
"""Common base class for protocol interfaces.
88
99
Usually user implements protocols that derived from BaseProtocol
1010
like Protocol or ProcessProtocol.
@@ -59,7 +59,7 @@ def resume_writing(self):
5959

6060

6161
class Protocol(BaseProtocol):
62-
"""ABC representing a protocol.
62+
"""Interface for stream protocol.
6363
6464
The user should implement this interface. They can inherit from
6565
this class but don't need to. The implementations here do
@@ -95,7 +95,7 @@ def eof_received(self):
9595

9696

9797
class DatagramProtocol(BaseProtocol):
98-
"""ABC representing a datagram protocol."""
98+
"""Interface for datagram protocol."""
9999

100100
def datagram_received(self, data, addr):
101101
"""Called when some datagram is received."""
@@ -108,7 +108,7 @@ def error_received(self, exc):
108108

109109

110110
class SubprocessProtocol(BaseProtocol):
111-
"""ABC representing a protocol for subprocess calls."""
111+
"""Interface for protocol for subprocess calls."""
112112

113113
def pipe_data_received(self, fd, data):
114114
"""Called when the subprocess writes data into stdout/stderr pipe.

Lib/asyncio/transports.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class BaseTransport:
7-
"""Base ABC for transports."""
7+
"""Base class for transports."""
88

99
def __init__(self, extra=None):
1010
if extra is None:
@@ -27,7 +27,7 @@ def close(self):
2727

2828

2929
class ReadTransport(BaseTransport):
30-
"""ABC for read-only transports."""
30+
"""Interface for read-only transports."""
3131

3232
def pause_reading(self):
3333
"""Pause the receiving end.
@@ -47,7 +47,7 @@ def resume_reading(self):
4747

4848

4949
class WriteTransport(BaseTransport):
50-
"""ABC for write-only transports."""
50+
"""Interface for write-only transports."""
5151

5252
def set_write_buffer_limits(self, high=None, low=None):
5353
"""Set the high- and low-water limits for write flow control.
@@ -115,7 +115,7 @@ def abort(self):
115115

116116

117117
class Transport(ReadTransport, WriteTransport):
118-
"""ABC representing a bidirectional transport.
118+
"""Interface representing a bidirectional transport.
119119
120120
There may be several implementations, but typically, the user does
121121
not implement new transports; rather, the platform provides some
@@ -137,7 +137,7 @@ class Transport(ReadTransport, WriteTransport):
137137

138138

139139
class DatagramTransport(BaseTransport):
140-
"""ABC for datagram (UDP) transports."""
140+
"""Interface for datagram (UDP) transports."""
141141

142142
def sendto(self, data, addr=None):
143143
"""Send data to the transport.

0 commit comments

Comments
 (0)