diff options
author | Guido van Rossum <guido@python.org> | 2013-11-30 23:35:42 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2013-11-30 23:35:42 (GMT) |
commit | 9204af42cc271690f57a4bc0d2af53201a796b51 (patch) | |
tree | 46f57604b46dc86236bc1f00ba034081c2d480fc | |
parent | 7c63c85f17ac5cef43d885748cf0b1893a8cd001 (diff) | |
download | cpython-9204af42cc271690f57a4bc0d2af53201a796b51.zip cpython-9204af42cc271690f57a4bc0d2af53201a796b51.tar.gz cpython-9204af42cc271690f57a4bc0d2af53201a796b51.tar.bz2 |
asyncio: Use Interface instead of ABC. Fixes issue 19726.
-rw-r--r-- | Lib/asyncio/events.py | 4 | ||||
-rw-r--r-- | Lib/asyncio/protocols.py | 8 | ||||
-rw-r--r-- | Lib/asyncio/transports.py | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index d429686..c10faa7 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -234,7 +234,7 @@ class AbstractEventLoop: protocol_factory should instantiate object with Protocol interface. pipe is file-like object already switched to nonblocking. Return pair (transport, protocol), where transport support - ReadTransport ABC""" + ReadTransport interface.""" # The reason to accept file-like object instead of just file descriptor # is: we need to own pipe and close it at transport finishing # Can got complicated errors if pass f.fileno(), @@ -247,7 +247,7 @@ class AbstractEventLoop: protocol_factory should instantiate object with BaseProtocol interface. Pipe is file-like object already switched to nonblocking. Return pair (transport, protocol), where transport support - WriteTransport ABC""" + WriteTransport interface.""" # The reason to accept file-like object instead of just file descriptor # is: we need to own pipe and close it at transport finishing # Can got complicated errors if pass f.fileno(), diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py index eb94fb6..1b8870c 100644 --- a/Lib/asyncio/protocols.py +++ b/Lib/asyncio/protocols.py @@ -4,7 +4,7 @@ __all__ = ['Protocol', 'DatagramProtocol'] class BaseProtocol: - """ABC for base protocol class. + """Common base class for protocol interfaces. Usually user implements protocols that derived from BaseProtocol like Protocol or ProcessProtocol. @@ -59,7 +59,7 @@ class BaseProtocol: class Protocol(BaseProtocol): - """ABC representing a protocol. + """Interface for stream protocol. The user should implement this interface. They can inherit from this class but don't need to. The implementations here do @@ -95,7 +95,7 @@ class Protocol(BaseProtocol): class DatagramProtocol(BaseProtocol): - """ABC representing a datagram protocol.""" + """Interface for datagram protocol.""" def datagram_received(self, data, addr): """Called when some datagram is received.""" @@ -108,7 +108,7 @@ class DatagramProtocol(BaseProtocol): class SubprocessProtocol(BaseProtocol): - """ABC representing a protocol for subprocess calls.""" + """Interface for protocol for subprocess calls.""" def pipe_data_received(self, fd, data): """Called when the subprocess writes data into stdout/stderr pipe. diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py index 98f9224..86b850e 100644 --- a/Lib/asyncio/transports.py +++ b/Lib/asyncio/transports.py @@ -4,7 +4,7 @@ __all__ = ['ReadTransport', 'WriteTransport', 'Transport'] class BaseTransport: - """Base ABC for transports.""" + """Base class for transports.""" def __init__(self, extra=None): if extra is None: @@ -27,7 +27,7 @@ class BaseTransport: class ReadTransport(BaseTransport): - """ABC for read-only transports.""" + """Interface for read-only transports.""" def pause_reading(self): """Pause the receiving end. @@ -47,7 +47,7 @@ class ReadTransport(BaseTransport): class WriteTransport(BaseTransport): - """ABC for write-only transports.""" + """Interface for write-only transports.""" def set_write_buffer_limits(self, high=None, low=None): """Set the high- and low-water limits for write flow control. @@ -115,7 +115,7 @@ class WriteTransport(BaseTransport): class Transport(ReadTransport, WriteTransport): - """ABC representing a bidirectional transport. + """Interface representing a bidirectional transport. There may be several implementations, but typically, the user does not implement new transports; rather, the platform provides some @@ -137,7 +137,7 @@ class Transport(ReadTransport, WriteTransport): class DatagramTransport(BaseTransport): - """ABC for datagram (UDP) transports.""" + """Interface for datagram (UDP) transports.""" def sendto(self, data, addr=None): """Send data to the transport. |