@@ -221,7 +221,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = {
221
221
(mp_obj_t )& mp_const_none_obj },
222
222
};
223
223
224
- //| byteorder: string = ...
224
+ //| byteorder: str = ...
225
225
//| """byteorder string for the buffer (read-only)"""
226
226
//|
227
227
STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder (mp_obj_t self_in ) {
@@ -257,7 +257,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) {
257
257
}
258
258
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (pixelbuf_pixelbuf_show_obj , pixelbuf_pixelbuf_show );
259
259
260
- //| def fill(color: Union[int, Tuple[int, int, int]]) -> None:
260
+ //| def fill(self, color: Union[int, Tuple[int, int, int]]) -> None:
261
261
//| """Fills the given pixelbuf with the given color."""
262
262
//| ...
263
263
//|
@@ -269,13 +269,19 @@ STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) {
269
269
}
270
270
STATIC MP_DEFINE_CONST_FUN_OBJ_2 (pixelbuf_pixelbuf_fill_obj , pixelbuf_pixelbuf_fill );
271
271
272
- //| def __getitem__(self, index: int) -> Tuple[int, int, int, Union[int, float]]:
272
+ //| @overload
273
+ //| def __getitem__(self, index: slice) -> Tuple[Tuple, ...]: ...
274
+ //| def __getitem__(self, index: int) -> Tuple:
273
275
//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values
274
276
//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel
275
277
//| intensity from 0-1.0."""
276
278
//| ...
277
279
//|
278
- //| def __setitem__(self, index: int, value: Union[int, Tuple[int, int, int, Union[int, float]]]) -> PixelBuf:
280
+ //| @overload
281
+ //| def __setitem__(self, index: slice, value: Tuple[Union[int, Tuple, List], ...]) -> None: ...
282
+ //| @overload
283
+ //| def __setitem__(self, index: slice, value: List[Union[int, Tuple, List]]) -> None: ...
284
+ //| def __setitem__(self, index: int, value: Union[int, Tuple, List]) -> None:
279
285
//| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are
280
286
//| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the
281
287
//| red, green and blue values are packed into the lower three bytes (0xRRGGBB).
0 commit comments