Closed DavidWhaleMEF closed 5 years ago
By experimentation alone, the return type appears to be a bytes() object.
It didn't seem clear to me from the documentation that this was the case, because it talks about characters (which implies a string) and bytes (which could be a bytes() or a bytearray() )
PR https://github.com/bbcmicrobit/micropython/pull/588 already covered the return type, was that enough or does it need something more explicit?
Thanks, commented in the PR. I will close this issue.
The current readthedocs does not say what data type and value uart.read() returns
https://microbit-micropython.readthedocs.io/en/latest/uart.html
It says:
So, does it read characters or does it read bytes? What does it return? characters does not equal bytes where character encodings are used. Also, what is the return type? If it returns characters, is this a string? If it returns bytes, is it a bytes() or a bytearray()?
The implication is that if you don't provide a parameter it reads characters, and if you do provide a parameter, it reads bytes, is that correct?