@@ -308,7 +308,7 @@ char *mp_obj_int_formatted(char **buf, size_t *buf_size, size_t *fmt_size, mp_co
308308void mp_obj_int_buffer_overflow_check (mp_obj_t self_in , size_t nbytes , bool is_signed ) {
309309 if (is_signed ) {
310310 // self must be < 2**(bits - 1)
311- mp_obj_t edge = mp_binary_op (MP_BINARY_OP_INPLACE_LSHIFT ,
311+ mp_obj_t edge = mp_binary_op (MP_BINARY_OP_LSHIFT ,
312312 mp_obj_new_int (1 ),
313313 mp_obj_new_int (nbytes * 8 - 1 ));
314314
@@ -323,7 +323,7 @@ void mp_obj_int_buffer_overflow_check(mp_obj_t self_in, size_t nbytes, bool is_s
323323 // self must be >= 0
324324 if (mp_obj_int_sign (self_in ) >= 0 ) {
325325 // and < 2**(bits)
326- mp_obj_t edge = mp_binary_op (MP_BINARY_OP_INPLACE_LSHIFT ,
326+ mp_obj_t edge = mp_binary_op (MP_BINARY_OP_LSHIFT ,
327327 mp_obj_new_int (1 ),
328328 mp_obj_new_int (nbytes * 8 ));
329329
@@ -536,7 +536,7 @@ static MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, MP_ROM_PTR(&int_from_
536536static mp_obj_t int_to_bytes (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
537537 enum { ARG_length , ARG_byteorder , ARG_signed };
538538 static const mp_arg_t allowed_args [] = {
539- { MP_QSTR_length , MP_ARG_REQUIRED | MP_ARG_INT , {.u_int = 0 } },
539+ { MP_QSTR_length , MP_ARG_INT , {.u_int = 1 } },
540540 // CIRCUITPY-CHANGE: not required and given a default value.
541541 { MP_QSTR_byteorder , MP_ARG_OBJ , {.u_obj = MP_OBJ_NEW_QSTR (MP_QSTR_big )} },
542542 { MP_QSTR_signed , MP_ARG_KW_ONLY | MP_ARG_BOOL , {.u_bool = false} },
@@ -578,8 +578,7 @@ static mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t *
578578
579579 return mp_obj_new_bytes_from_vstr (& vstr );
580580}
581- // CIRCUITPY-CHANGE: only two required args.
582- static MP_DEFINE_CONST_FUN_OBJ_KW (int_to_bytes_obj , 2 , int_to_bytes ) ;
581+ static MP_DEFINE_CONST_FUN_OBJ_KW (int_to_bytes_obj , 1 , int_to_bytes ) ;
583582
584583static const mp_rom_map_elem_t int_locals_dict_table [] = {
585584 // CIRCUITPY-CHANGE
0 commit comments