QUERY · ISSUE
uasyncio V3 stream readline: is this correct?
extmod
The readline method returns if the final character is a newline. However it is possible that self.s.readline() might return more than one line. Should Stream.readline find the first newline and return a partial result? CPython docs:
Read one line, where “line” is a sequence of bytes ending with \n.
In the existing design the onus is on the device s to return a maximum of one line. Is this correct?
CANDIDATE · ISSUE
uasyncio StreamReader.read(n) CPython incompatibility
extmod
MicroPython requires a value n while the CPython method has a default value n=-1. See the docs:
coroutine read(n=-1)
Read up to n bytes. If n is not provided, or set to -1, read until EOF and return all read bytes.
If EOF was received and the internal buffer is empty, return an empty bytes object.
Raised by this user.