File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ machine_int_t mp_obj_hash(mp_obj_t o_in) {
110110 return 1 ; // needs to hash to same as the integer 1, since True==1
111111 } else if (MP_OBJ_IS_SMALL_INT (o_in )) {
112112 return MP_OBJ_SMALL_INT_VALUE (o_in );
113- } else if (MP_OBJ_IS_STR (o_in )) {
113+ } else if (MP_OBJ_IS_STR (o_in ) || MP_OBJ_IS_TYPE ( o_in , & mp_type_bytes ) ) {
114114 return mp_obj_str_get_hash (o_in );
115115 } else if (MP_OBJ_IS_TYPE (o_in , & mp_type_NoneType )) {
116116 return (machine_int_t )o_in ;
Original file line number Diff line number Diff line change @@ -1480,7 +1480,8 @@ STATIC void bad_implicit_conversion(mp_obj_t self_in) {
14801480}
14811481
14821482uint mp_obj_str_get_hash (mp_obj_t self_in ) {
1483- if (MP_OBJ_IS_STR (self_in )) {
1483+ // TODO: This has too big overhead for hash accessor
1484+ if (MP_OBJ_IS_STR (self_in ) || MP_OBJ_IS_TYPE (self_in , & mp_type_bytes )) {
14841485 GET_STR_HASH (self_in , h );
14851486 return h ;
14861487 } else {
You can’t perform that action at this time.
0 commit comments