mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
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:
parent
7211d306d4
commit
5344501ad1
4 changed files with 68 additions and 24 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue