micropython-stubs icon indicating copy to clipboard operation
micropython-stubs copied to clipboard

create mpy_shed/reference stubs for MicroPython Buffer protocol

Open Josverl opened this issue 3 months ago • 0 comments

This is likely a good addition to reference_mpy_shed\buffer_mp.pyi but care must be taken to verify correct operation and conflicts.

Also need to determine how to work with , or replace AnyReadableBuf and AnyWritableBuf

The signature is:

stream.write(buf)
stream.write(buf, max_len)
stream.write(buf, off, max_len)

I don't think this is actually documented anywhere, but it may be relied upon in some code.

Originally posted by @dpgeorge in https://github.com/micropython/micropython/pull/17938#discussion_r2329804709

Josverl avatar Sep 08 '25 10:09 Josverl