Skip to content

Commit da4f2db

Browse files
committed
Add missing type annotations
These are treated as warnings by extract_pyi, so they don't stop the build process.
1 parent a7b10d4 commit da4f2db

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

shared-bindings/hashlib/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//| |see_cpython_module| :mod:`cpython:hashlib`.
3939
//| """
4040
//|
41-
//| def new(name, data=b"") -> hashlib.Hash:
41+
//| def new(name: str, data: bytes=b"") -> hashlib.Hash:
4242
//| """Returns a Hash object setup for the named algorithm. Raises ValueError when the named
4343
//| algorithm is unsupported.
4444
//|

shared-bindings/usb/core/Device.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_manufacturer_obj, usb_core_device_
130130
MP_PROPERTY_GETTER(usb_core_device_manufacturer_obj,
131131
(mp_obj_t)&usb_core_device_get_manufacturer_obj);
132132

133-
//| def write(self, endpoint: int, data: ReadableBuffer, timeout = None) -> int:
133+
//| def write(self, endpoint: int, data: ReadableBuffer, timeout:Optional[int] = None) -> int:
134134
//| """Write data to a specific endpoint on the device.
135135
//|
136136
//| :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
159159
MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_write_obj, 2, usb_core_device_write);
160160

161161

162-
//| def read(self, endpoint: int, size_or_buffer: array.array, timeout = None) -> int:
162+
//| def read(self, endpoint: int, size_or_buffer: array.array, timeout:Optional[int] = None) -> int:
163163
//| """Read data from the endpoint.
164164
//|
165165
//| :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
186186
}
187187
MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_read_obj, 2, usb_core_device_read);
188188

189-
//| def ctrl_transfer(self, bmRequestType, bRequest, wValue=0, wIndex=0,
190-
//| data_or_wLength: Optional[array.array] = None, timeout = None) -> int:
189+
//| def ctrl_transfer(self, bmRequestType:int, bRequest:int, wValue:int=0, wIndex:int=0,
190+
//| data_or_wLength: Optional[array.array] = None, timeout:Optional[int] = None) -> int:
191191
//| """Do a control transfer on the endpoint 0. The parameters bmRequestType,
192192
//| bRequest, wValue and wIndex are the same of the USB Standard Control
193193
//| Request format.
@@ -254,7 +254,7 @@ STATIC mp_obj_t usb_core_device_is_kernel_driver_active(mp_obj_t self_in, mp_obj
254254
}
255255
MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_is_kernel_driver_active_obj, usb_core_device_is_kernel_driver_active);
256256

257-
//| def detach_kernel_driver(self, interface: int):
257+
//| def detach_kernel_driver(self, interface: int) -> None:
258258
//| """Stop CircuitPython from using the interface. If successful, you
259259
//| will then be able to perform I/O. CircuitPython will automatically
260260
//| 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
271271
}
272272
MP_DEFINE_CONST_FUN_OBJ_2(usb_core_device_detach_kernel_driver_obj, usb_core_device_detach_kernel_driver);
273273

274-
//| def attach_kernel_driver(self, interface: int):
274+
//| def attach_kernel_driver(self, interface: int) -> None:
275275
//| """Allow CircuitPython to use the interface if it wants to.
276276
//|
277277
//| :param int interface: the device interface number to allow CircuitPython to use

shared-bindings/usb/core/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ NORETURN void mp_raise_usb_core_USBTimeoutError(void) {
6464
}
6565

6666

67-
//| def find(find_all=False, *, idVendor=None, idProduct=None):
67+
//| def find(find_all:bool=False, *, idVendor:Optional[int]=None, idProduct:Optional[int]=None) -> Device:
6868
//| """Find the first device that matches the given requirements or, if
6969
//| find_all is True, return a generator of all matching devices.
7070
//|

0 commit comments

Comments
 (0)