Added type hints to usb_midi

This commit is contained in:
dherrada 2020-07-03 11:40:20 -04:00
parent e089862a6c
commit 9c842c5a67
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@
// These are standard stream methods. Code is in py/stream.c. // 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 //| """Read characters. If ``nbytes`` is specified then read at most that many
//| bytes. Otherwise, read everything that arrives until the connection //| bytes. Otherwise, read everything that arrives until the connection
//| times out. Providing the number of bytes expected is highly recommended //| times out. Providing the number of bytes expected is highly recommended
@ -58,7 +58,7 @@
//| :rtype: bytes or None""" //| :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 //| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
//| that many bytes. Otherwise, read at most ``len(buf)`` bytes. //| that many bytes. Otherwise, read at most ``len(buf)`` bytes.
//| //|

View File

@ -47,7 +47,7 @@
// These are standard stream methods. Code is in py/stream.c. // 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. //| """Write the buffer of bytes to the bus.
//| //|
//| :return: the number of bytes written //| :return: the number of bytes written