bpo-35394: Add empty slots to abstract asyncio protocols (#10889)

* bpo-35394: Add empty slots to abstract asyncio protocols

* Add missing test file
This commit is contained in:
Andrew Svetlov 2018-12-11 19:07:05 +02:00 committed by GitHub
parent 7211d306d4
commit 5344501ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 24 deletions

View file

@ -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.