Skip to content

Commit 9c842c5

Browse files
committed
Added type hints to usb_midi
1 parent e089862 commit 9c842c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

shared-bindings/usb_midi/PortIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
// These are standard stream methods. Code is in py/stream.c.
5050
//
51-
//| def read(self, nbytes: Any = None) -> Any:
51+
//| def read(self, nbytes: int = None) -> Optional[bytes]:
5252
//| """Read characters. If ``nbytes`` is specified then read at most that many
5353
//| bytes. Otherwise, read everything that arrives until the connection
5454
//| times out. Providing the number of bytes expected is highly recommended
@@ -58,7 +58,7 @@
5858
//| :rtype: bytes or None"""
5959
//| ...
6060
//|
61-
//| def readinto(self, buf: Any, nbytes: Any = None) -> Any:
61+
//| def readinto(self, buf: WriteableBuffer, nbytes: int = None) -> Optional[bytes]:
6262
//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
6363
//| that many bytes. Otherwise, read at most ``len(buf)`` bytes.
6464
//|

shared-bindings/usb_midi/PortOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
// These are standard stream methods. Code is in py/stream.c.
4949
//
50-
//| def write(self, buf: Any) -> Any:
50+
//| def write(self, buf: ReadableBuffer) -> Optional[int]:
5151
//| """Write the buffer of bytes to the bus.
5252
//|
5353
//| :return: the number of bytes written

0 commit comments

Comments
 (0)