Skip to content

Commit a392b3a

Browse files
committed
docs: Remove references to readall() and update stream read() docs.
1 parent aed3b5b commit a392b3a

4 files changed

Lines changed: 12 additions & 28 deletions

File tree

docs/library/machine.UART.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A UART object acts like a stream object and reading and writing is done
3131
using the standard stream methods::
3232

3333
uart.read(10) # read 10 characters, returns a bytes object
34-
uart.readall() # read all available characters
34+
uart.read() # read all available characters
3535
uart.readline() # read a line
3636
uart.readinto(buf) # read and store into the given buffer
3737
uart.write('abc') # write the 3 characters
@@ -95,17 +95,12 @@ Methods
9595

9696
.. method:: UART.read([nbytes])
9797

98-
Read characters. If ``nbytes`` is specified then read at most that many bytes.
98+
Read characters. If ``nbytes`` is specified then read at most that many bytes,
99+
otherwise read as much data as possible.
99100

100101
Return value: a bytes object containing the bytes read in. Returns ``None``
101102
on timeout.
102103

103-
.. method:: UART.readall()
104-
105-
Read as much data as possible.
106-
107-
Return value: a bytes object or ``None`` on timeout.
108-
109104
.. method:: UART.readinto(buf[, nbytes])
110105

111106
Read bytes into the ``buf``. If ``nbytes`` is specified then read at most

docs/library/pyb.UART.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ A UART object acts like a stream object and reading and writing is done
2727
using the standard stream methods::
2828

2929
uart.read(10) # read 10 characters, returns a bytes object
30-
uart.readall() # read all available characters
30+
uart.read() # read all available characters
3131
uart.readline() # read a line
3232
uart.readinto(buf) # read and store into the given buffer
3333
uart.write('abc') # write the 3 characters
@@ -122,6 +122,9 @@ Methods
122122
If ``nbytes`` are available in the buffer, returns immediately, otherwise returns
123123
when sufficient characters arrive or the timeout elapses.
124124

125+
If ``nbytes`` is not given then the method reads as much data as possible. It
126+
returns after the timeout has elapsed.
127+
125128
.. only:: port_pyboard
126129

127130
*Note:* for 9 bit characters each character takes two bytes, ``nbytes`` must
@@ -130,12 +133,6 @@ Methods
130133
Return value: a bytes object containing the bytes read in. Returns ``None``
131134
on timeout.
132135

133-
.. method:: UART.readall()
134-
135-
Read as much data as possible. Returns after the timeout has elapsed.
136-
137-
Return value: a bytes object or ``None`` if timeout prevents any data being read.
138-
139136
.. method:: UART.readchar()
140137

141138
Receive a single character on the bus.

docs/library/pyb.USB_VCP.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,12 @@ Methods
4444
.. method:: USB_VCP.read([nbytes])
4545

4646
Read at most ``nbytes`` from the serial device and return them as a
47-
bytes object. If ``nbytes`` is not specified then the method acts as
48-
``readall()``. USB_VCP stream implicitly works in non-blocking mode,
47+
bytes object. If ``nbytes`` is not specified then the method reads
48+
all available bytes from the serial device.
49+
USB_VCP stream implicitly works in non-blocking mode,
4950
so if no pending data available, this method will return immediately
5051
with ``None`` value.
5152

52-
.. method:: USB_VCP.readall()
53-
54-
Read all available bytes from the serial device and return them as
55-
a bytes object, or ``None`` if no pending data available.
56-
5753
.. method:: USB_VCP.readinto(buf, [maxlen])
5854

5955
Read bytes from the serial device and store them into ``buf``, which

docs/library/usocket.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,10 @@ Methods
178178
Closing the file object returned by makefile() WILL close the
179179
original socket as well.
180180

181-
.. method:: socket.read(size)
181+
.. method:: socket.read([size])
182182

183183
Read up to size bytes from the socket. Return a bytes object. If ``size`` is not given, it
184-
behaves just like ``socket.readall()``, see below.
185-
186-
.. method:: socket.readall()
187-
188-
Read all data available from the socket until ``EOF``. This function will not return until
184+
reads all data available from the socket until ``EOF``; as such the method will not return until
189185
the socket is closed.
190186

191187
.. method:: socket.readinto(buf[, nbytes])

0 commit comments

Comments
 (0)