diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 9d9310b47a..176283cd50 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -48,7 +48,7 @@ // These are standard stream methods. Code is in py/stream.c. // -//| def read(self, nbytes: Any = None) -> Any: +//| def read(self, nbytes: int = None) -> Optional[bytes]: //| """Read characters. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended @@ -58,7 +58,7 @@ //| :rtype: bytes or None""" //| ... //| -//| def readinto(self, buf: Any, nbytes: Any = None) -> Any: +//| def readinto(self, buf: WriteableBuffer, nbytes: int = None) -> Optional[bytes]: //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most //| that many bytes. Otherwise, read at most ``len(buf)`` bytes. //| diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index b4afbc0362..92ed451e97 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -47,7 +47,7 @@ // These are standard stream methods. Code is in py/stream.c. // -//| def write(self, buf: Any) -> Any: +//| def write(self, buf: ReadableBuffer) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| :return: the number of bytes written