Add missing type annotations

These are treated as warnings by extract_pyi, so they don't stop
the build process.
This commit is contained in:
Jeff Epler 2022-09-27 09:08:41 -05:00
parent a7b10d41b4
commit da4f2db1df
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
3 changed files with 8 additions and 8 deletions

View File

@ -38,7 +38,7 @@
//| |see_cpython_module| :mod:`cpython:hashlib`. //| |see_cpython_module| :mod:`cpython:hashlib`.
//| """ //| """
//| //|
//| def new(name, data=b"") -> hashlib.Hash: //| def new(name: str, data: bytes=b"") -> hashlib.Hash:
//| """Returns a Hash object setup for the named algorithm. Raises ValueError when the named //| """Returns a Hash object setup for the named algorithm. Raises ValueError when the named
//| algorithm is unsupported. //| algorithm is unsupported.
//| //|

View File

@ -130,7 +130,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_manufacturer_obj, usb_core_device_
MP_PROPERTY_GETTER(usb_core_device_manufacturer_obj, MP_PROPERTY_GETTER(usb_core_device_manufacturer_obj,
(mp_obj_t)&usb_core_device_get_manufacturer_obj); (mp_obj_t)&usb_core_device_get_manufacturer_obj);
//| def write(self, endpoint: int, data: ReadableBuffer, timeout = None) -> int: //| def write(self, endpoint: int, data: ReadableBuffer, timeout:Optional[int] = None) -> int:
//| """Write data to a specific endpoint on the device. //| """Write data to a specific endpoint on the device.
//| //|
//| :param int endpoint: the bEndpointAddress you want to communicate with. //| :param int endpoint: the bEndpointAddress you want to communicate with.
@ -159,7 +159,7 @@ STATIC mp_obj_t usb_core_device_write(size_t n_args, const mp_obj_t *pos_args, m
MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_write_obj, 2, usb_core_device_write); MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_write_obj, 2, usb_core_device_write);
//| def read(self, endpoint: int, size_or_buffer: array.array, timeout = None) -> int: //| def read(self, endpoint: int, size_or_buffer: array.array, timeout:Optional[int] = None) -> int:
//| """Read data from the endpoint. //| """Read data from the endpoint.
//| //|
//| :param int endpoint: the bEndpointAddress you want to communicate with. //| :param int endpoint: the bEndpointAddress you want to communicate with.
@ -186,8 +186,8 @@ STATIC mp_obj_t usb_core_device_read(size_t n_args, const mp_obj_t *pos_args, mp
} }
MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_read_obj, 2, usb_core_device_read); MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_read_obj, 2, usb_core_device_read);
//| def ctrl_transfer(self, bmRequestType, bRequest, wValue=0, wIndex=0, //| def ctrl_transfer(self, bmRequestType:int, bRequest:int, wValue:int=0, wIndex:int=0,
//| data_or_wLength: Optional[array.array] = None, timeout = None) -> int: //| data_or_wLength: Optional[array.array] = None, timeout:Optional[int] = None) -> int:
//| """Do a control transfer on the endpoint 0. The parameters bmRequestType, //| """Do a control transfer on the endpoint 0. The parameters bmRequestType,
//| bRequest, wValue and wIndex are the same of the USB Standard Control //| bRequest, wValue and wIndex are the same of the USB Standard Control
//| Request format. //| Request format.
@ -254,7 +254,7 @@ STATIC mp_obj_t usb_core_device_is_kernel_driver_active(mp_obj_t self_in, mp_obj
} }
MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_is_kernel_driver_active_obj, usb_core_device_is_kernel_driver_active); MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_is_kernel_driver_active_obj, usb_core_device_is_kernel_driver_active);
//| def detach_kernel_driver(self, interface: int): //| def detach_kernel_driver(self, interface: int) -> None:
//| """Stop CircuitPython from using the interface. If successful, you //| """Stop CircuitPython from using the interface. If successful, you
//| will then be able to perform I/O. CircuitPython will automatically //| will then be able to perform I/O. CircuitPython will automatically
//| re-start using the interface on reload. //| re-start using the interface on reload.
@ -271,7 +271,7 @@ STATIC mp_obj_t usb_core_device_detach_kernel_driver(mp_obj_t self_in, mp_obj_t
} }
MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_detach_kernel_driver_obj, usb_core_device_detach_kernel_driver); MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_detach_kernel_driver_obj, usb_core_device_detach_kernel_driver);
//| def attach_kernel_driver(self, interface: int): //| def attach_kernel_driver(self, interface: int) -> None:
//| """Allow CircuitPython to use the interface if it wants to. //| """Allow CircuitPython to use the interface if it wants to.
//| //|
//| :param int interface: the device interface number to allow CircuitPython to use //| :param int interface: the device interface number to allow CircuitPython to use

View File

@ -64,7 +64,7 @@ NORETURN void mp_raise_usb_core_USBTimeoutError(void) {
} }
//| def find(find_all=False, *, idVendor=None, idProduct=None): //| def find(find_all:bool=False, *, idVendor:Optional[int]=None, idProduct:Optional[int]=None) -> Device:
//| """Find the first device that matches the given requirements or, if //| """Find the first device that matches the given requirements or, if
//| find_all is True, return a generator of all matching devices. //| find_all is True, return a generator of all matching devices.
//| //|