diff options
| author | DavePutz <dwputz@gmail.com> | 2020-07-24 20:29:53 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-24 20:29:53 -0500 |
| commit | 3dfed3c4aa52d06bd2eb1c28d0a1916821cc3f80 (patch) | |
| tree | e585876c4e4d3500ba42dfceeb11c5bd11e7dd74 /shared-bindings/struct | |
| parent | a14101cd137e56002ff0599d99f8234966786454 (diff) | |
| parent | a6e048686fe6999c4231582b7d9e69a7dc679257 (diff) | |
Merge pull request #15 from adafruit/main
update from main
Diffstat (limited to 'shared-bindings/struct')
| -rw-r--r-- | shared-bindings/struct/__init__.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 26c0ff3af..de357dde4 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -62,7 +62,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) { } MP_DEFINE_CONST_FUN_OBJ_1(struct_calcsize_obj, struct_calcsize); -//| def pack(fmt: Any, *values: Any) -> Any: +//| def pack(fmt: string, *values: ReadableBuffer) -> bytes: //| """Pack the values according to the format string fmt. //| The return value is a bytes object encoding the values.""" //| ... @@ -80,7 +80,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_obj, 1, MP_OBJ_FUN_ARGS_MAX, struct_pack); -//| def pack_into(fmt: Any, buffer: Any, offset: Any, *values: Any) -> Any: +//| def pack_into(fmt: string, buffer: WriteableBuffer, offset: int, *values: readableBuffer) -> None: //| """Pack the values according to the format string fmt into a buffer //| starting at offset. offset may be negative to count from the end of buffer.""" //| ... @@ -106,7 +106,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_pack_into_obj, 3, MP_OBJ_FUN_ARGS_MAX, struct_pack_into); -//| def unpack(fmt: Any, data: Any) -> Any: +//| def unpack(fmt: string, data: ReadableBuffer) -> tuple: //| """Unpack from the data according to the format string fmt. The return value //| is a tuple of the unpacked values. The buffer size must match the size //| required by the format.""" @@ -124,7 +124,7 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(struct_unpack_obj, 2, 3, struct_unpack); -//| def unpack_from(fmt: Any, data: Any, offset: Any = 0) -> Any: +//| def unpack_from(fmt: string, data: ReadableBuffer, offset: int = 0) -> tuple: //| """Unpack from the data starting at offset according to the format string fmt. //| offset may be negative to count from the end of buffer. The return value is //| a tuple of the unpacked values. The buffer size must be at least as big |
