[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
ethan at stoneleaf.us
Wed Jan 8 17:12:46 CET 2014
On 01/08/2014 02:28 AM, Antoine Pitrou wrote:
> On Wed, 8 Jan 2014 11:02:19 +0100
> Victor Stinner <victor.stinner at gmail.com> wrote:
>>> What does b'%s' % 7 do?
>> See Examples of the PEP:
>> b'a%sc%s' % (b'b', 4) gives b'abc4'
>>> And then what? Use the "default" encoding? ASCII?
>> Bytes have no encoding. There are just bytes :-)
> Therefore you shouldn't accept integers. It does not make sense to
> format 4 as b'4'.
Agreed. I would have that it would result in b'\x04'.
More information about the Python-Dev