@@ -490,6 +490,7 @@ static mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t
490490 enum { ARG_bytes , ARG_byteorder , ARG_signed };
491491 static const mp_arg_t allowed_args [] = {
492492 { MP_QSTR_bytes , MP_ARG_REQUIRED | MP_ARG_OBJ , {.u_obj = NULL } },
493+ // CIRCUITPY-CHANGE: not required and given a default value.
493494 { MP_QSTR_byteorder , MP_ARG_OBJ , {.u_obj = MP_OBJ_NEW_QSTR (MP_QSTR_big )} },
494495 { MP_QSTR_signed , MP_ARG_KW_ONLY | MP_ARG_BOOL , {.u_bool = false} },
495496 };
@@ -527,6 +528,7 @@ static mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t
527528 return mp_obj_new_int_from_uint (value );
528529}
529530
531+ // CIRCUITPY-CHANGE: only two required args.
530532static MP_DEFINE_CONST_FUN_OBJ_KW (int_from_bytes_fun_obj , 2 , int_from_bytes ) ;
531533static MP_DEFINE_CONST_CLASSMETHOD_OBJ (int_from_bytes_obj , MP_ROM_PTR (& int_from_bytes_fun_obj )) ;
532534
@@ -535,6 +537,7 @@ static mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
535537 enum { ARG_length , ARG_byteorder , ARG_signed };
536538 static const mp_arg_t allowed_args [] = {
537539 { MP_QSTR_length , MP_ARG_REQUIRED | MP_ARG_INT , {.u_int = 0 } },
540+ // CIRCUITPY-CHANGE: not required and given a default value.
538541 { MP_QSTR_byteorder , MP_ARG_OBJ , {.u_obj = MP_OBJ_NEW_QSTR (MP_QSTR_big )} },
539542 { MP_QSTR_signed , MP_ARG_KW_ONLY | MP_ARG_BOOL , {.u_bool = false} },
540543 };
@@ -575,6 +578,7 @@ static mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
575578
576579 return mp_obj_new_bytes_from_vstr (& vstr );
577580}
581+ // CIRCUITPY-CHANGE: only two required args.
578582static MP_DEFINE_CONST_FUN_OBJ_KW (int_to_bytes_obj , 2 , int_to_bytes ) ;
579583
580584static const mp_rom_map_elem_t int_locals_dict_table [] = {
0 commit comments