summaryrefslogtreecommitdiff
path: root/docs/library
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-08-22 16:39:15 +1000
committerDamien George <damien@micropython.org>2022-06-24 17:04:57 +1000
commitdb7682e02d3ffd3338f20effc9ad4735a48bf774 (patch)
tree622dec3e91f0a9fc73ff0f6f0505e504bc8b50a5 /docs/library
parent2a2589738c7bcc0a318f9054562de9a62575d8cc (diff)
extmod/uasyncio: Implement stream read(-1) to read all data up to EOF.
Fixes issue #6355. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/uasyncio.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/library/uasyncio.rst b/docs/library/uasyncio.rst
index 0c7170242..0abbf8dd8 100644
--- a/docs/library/uasyncio.rst
+++ b/docs/library/uasyncio.rst
@@ -237,9 +237,11 @@ TCP stream connections
This is a coroutine.
-.. method:: Stream.read(n)
+.. method:: Stream.read(n=-1)
- Read up to *n* bytes and return them.
+ Read up to *n* bytes and return them. If *n* is not provided or -1 then read all
+ bytes until EOF. The returned value will be an empty bytes object if EOF is
+ encountered before any bytes are read.
This is a coroutine.