diff options
Diffstat (limited to 'Lib/asyncio/protocols.py')
-rw-r--r-- | Lib/asyncio/protocols.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py index dc298a8d5c9..b8d2e6be552 100644 --- a/Lib/asyncio/protocols.py +++ b/Lib/asyncio/protocols.py @@ -130,11 +130,15 @@ class BufferedProtocol(BaseProtocol): * CL: connection_lost() """ - def get_buffer(self): + def get_buffer(self, sizehint): """Called to allocate a new receive buffer. + *sizehint* is a recommended minimal size for the returned + buffer. When set to -1, the buffer size can be arbitrary. + Must return an object that implements the :ref:`buffer protocol <bufferobjects>`. + It is an error to return a zero-sized buffer. """ def buffer_updated(self, nbytes): @@ -185,7 +189,3 @@ class SubprocessProtocol(BaseProtocol): def process_exited(self): """Called when subprocess has exited.""" - - -def _is_buffered_protocol(proto): - return hasattr(proto, 'get_buffer') and not hasattr(proto, 'data_received') |