Armin Rigo added the comment:
(S6) 'xxx' % b'foo' == 'xxx'
b'xxx' % b'foo' raises TypeError
The first case is because PyMapping_Check() is true on b'foo', so it works like
'xxx' % {...}, which always just returns 'xxx'. The second case is because
_PyBytes_Format() contains more special cases, for bytes and bytearray, which
are not present in PyUnicode_Format().
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com