[Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2

Victor Stinner victor.stinner at gmail.com
Mon Feb 24 10:14:38 CET 2014

2014-02-24 3:45 GMT+01:00 Nick Coghlan <ncoghlan at gmail.com>:
> Would leaving %a out destroy the utility of the PEP?

Usually, debug code is not even commited. So writing b'var=%s' %
ascii(var).encode() is not hard.

Or maybe: b'var=%s' % repr(var).encode('ascii', 'backslashreplace')
which is the same but longer :-)


More information about the Python-Dev mailing list