summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-03 11:40:20 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-03 11:40:20 -0400
commit9c842c5a670117751785edae8f6355cae8f27ced (patch)
treea66e31f470d77e55e1304e1b2a838bae1b8f9975
parente089862a6c7bcd8274ff45512f92b1330a01b3ae (diff)
Added type hints to usb_midi
-rw-r--r--shared-bindings/usb_midi/PortIn.c4
-rw-r--r--shared-bindings/usb_midi/PortOut.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c
index 9d9310b47..176283cd5 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 b4afbc036..92ed451e9 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