@@ -62,7 +62,7 @@ STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) {
62
62
}
63
63
MP_DEFINE_CONST_FUN_OBJ_1 (struct_calcsize_obj , struct_calcsize );
64
64
65
- //| def pack(fmt: Any , *values: Any ) -> Any :
65
+ //| def pack(fmt: string , *values: ReadableBuffer ) -> bytes :
66
66
//| """Pack the values according to the format string fmt.
67
67
//| The return value is a bytes object encoding the values."""
68
68
//| ...
@@ -80,7 +80,7 @@ STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) {
80
80
}
81
81
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (struct_pack_obj , 1 , MP_OBJ_FUN_ARGS_MAX , struct_pack );
82
82
83
- //| def pack_into(fmt: Any , buffer: Any , offset: Any , *values: Any ) -> Any :
83
+ //| def pack_into(fmt: string , buffer: WriteableBuffer , offset: int , *values: readableBuffer ) -> None :
84
84
//| """Pack the values according to the format string fmt into a buffer
85
85
//| starting at offset. offset may be negative to count from the end of buffer."""
86
86
//| ...
@@ -106,7 +106,7 @@ STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) {
106
106
}
107
107
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (struct_pack_into_obj , 3 , MP_OBJ_FUN_ARGS_MAX , struct_pack_into );
108
108
109
- //| def unpack(fmt: Any , data: Any ) -> Any :
109
+ //| def unpack(fmt: string , data: ReadableBuffer ) -> tuple :
110
110
//| """Unpack from the data according to the format string fmt. The return value
111
111
//| is a tuple of the unpacked values. The buffer size must match the size
112
112
//| required by the format."""
@@ -124,7 +124,7 @@ STATIC mp_obj_t struct_unpack(size_t n_args, const mp_obj_t *args) {
124
124
}
125
125
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (struct_unpack_obj , 2 , 3 , struct_unpack );
126
126
127
- //| def unpack_from(fmt: Any , data: Any , offset: Any = 0) -> Any :
127
+ //| def unpack_from(fmt: string , data: ReadableBuffer , offset: int = 0) -> tuple :
128
128
//| """Unpack from the data starting at offset according to the format string fmt.
129
129
//| offset may be negative to count from the end of buffer. The return value is
130
130
//| a tuple of the unpacked values. The buffer size must be at least as big
0 commit comments