py/objstr: Add hex/fromhex to bytes/memoryview/bytearray.
These were added in Python 3.5. Enabled via MICROPY_PY_BUILTINS_BYTES_HEX, and enabled by default for all ports that currently have ubinascii. Rework ubinascii to use the implementation of these methods. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
@@ -127,8 +127,15 @@ MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj);
|
||||
MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj);
|
||||
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(bytes_decode_obj);
|
||||
|
||||
mp_obj_t mp_obj_bytes_hex(size_t n_args, const mp_obj_t *args, const mp_obj_type_t *type);
|
||||
mp_obj_t mp_obj_bytes_fromhex(mp_obj_t type_in, mp_obj_t data);
|
||||
|
||||
extern const mp_obj_dict_t mp_obj_str_locals_dict;
|
||||
|
||||
#if MICROPY_PY_BUILTINS_MEMORYVIEW && MICROPY_PY_BUILTINS_BYTES_HEX
|
||||
extern const mp_obj_dict_t mp_obj_memoryview_locals_dict;
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_BUILTINS_BYTEARRAY
|
||||
extern const mp_obj_dict_t mp_obj_bytearray_locals_dict;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user