Commit b013aea8 authored by Damien George's avatar Damien George
Browse files

py: Fix builtin hex to print prefix.

I was too hasty.  Still a one-liner though.
parent 58051117
......@@ -208,7 +208,7 @@ STATIC mp_obj_t mp_builtin_hash(mp_obj_t o_in) {
MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_hash_obj, mp_builtin_hash);
STATIC mp_obj_t mp_builtin_hex(mp_obj_t o_in) {
return mp_binary_op(MP_BINARY_OP_MODULO, MP_OBJ_NEW_QSTR(MP_QSTR__percent_x), o_in);
return mp_binary_op(MP_BINARY_OP_MODULO, MP_OBJ_NEW_QSTR(MP_QSTR__percent__hash_x), o_in);
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_builtin_hex_obj, mp_builtin_hex);
......
......@@ -17,6 +17,7 @@ codepoint2name[ord('.')] = 'dot'
codepoint2name[ord(':')] = 'colon'
codepoint2name[ord('/')] = 'slash'
codepoint2name[ord('%')] = 'percent'
codepoint2name[ord('#')] = 'hash'
# this must match the equivalent function in qstr.c
def compute_hash(qstr):
......
......@@ -107,7 +107,7 @@ Q(getattr)
Q(globals)
Q(hash)
Q(hex)
Q(%x)
Q(%#x)
Q(id)
Q(io)
Q(int)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment