golang_str: bstr/ustr repr
Teach bstr/ustr to provide repr of themselves: it goes as b(...) and u(...) where u stands for human-readable repr of contained data. Human-readable means that non-ascii printable unicode characters are shown as-is instead of escaping them, for example: >>> x = u'αβγ' >>> x 'αβγ' >>> y = b(x) >>> y b('αβγ') <-- NOTE not b(b'\xce\xb1\xce\xb2\xce\xb3') >>> x.encode('utf-8') b'\xce\xb1\xce\xb2\xce\xb3'
Showing
Please register or sign in to comment