diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-12-11 17:07:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 17:07:05 (GMT) |
commit | 5344501ad166c1380be452644a863a4679c4291b (patch) | |
tree | 4a2d9f0b0a7225db78451d7720f4189694ea04a9 /Lib/asyncio | |
parent | 7211d306d4c2f73732540759e20dd17bd18b3361 (diff) | |
download | cpython-5344501ad166c1380be452644a863a4679c4291b.zip cpython-5344501ad166c1380be452644a863a4679c4291b.tar.gz cpython-5344501ad166c1380be452644a863a4679c4291b.tar.bz2 |
bpo-35394: Add empty slots to abstract asyncio protocols (#10889)
* bpo-35394: Add empty slots to abstract asyncio protocols
* Add missing test file
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/protocols.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py index a35ea82..69fa43e 100644 --- a/Lib/asyncio/protocols.py +++ b/Lib/asyncio/protocols.py @@ -16,6 +16,8 @@ class BaseProtocol: write-only transport like write pipe """ + __slots__ = () + def connection_made(self, transport): """Called when a connection is made. @@ -87,6 +89,8 @@ class Protocol(BaseProtocol): * CL: connection_lost() """ + __slots__ = () + def data_received(self, data): """Called when some data is received. @@ -130,6 +134,8 @@ class BufferedProtocol(BaseProtocol): * CL: connection_lost() """ + __slots__ = () + def get_buffer(self, sizehint): """Called to allocate a new receive buffer. @@ -160,6 +166,8 @@ class BufferedProtocol(BaseProtocol): class DatagramProtocol(BaseProtocol): """Interface for datagram protocol.""" + __slots__ = () + def datagram_received(self, data, addr): """Called when some datagram is received.""" @@ -173,6 +181,8 @@ class DatagramProtocol(BaseProtocol): class SubprocessProtocol(BaseProtocol): """Interface for protocol for subprocess calls.""" + __slots__ = () + def pipe_data_received(self, fd, data): """Called when the subprocess writes data into stdout/stderr pipe. |