On 12 January 2014 16:52, Kristján Valur Jónsson <krist...@ccpgames.com> wrote: > I mean, basically what I am suggesting is that in addition to %b with > > def helper(o): > return str(o).encode('ascii', 'strict') > > b'foo%bbar'%(helper(myobj), ) > > you have > > b'foo%sbar'%(myobj, )
But that's not what the current PEP says. It uses %s for interpolating bytes values. It looks like you're saying that b'abc %s' % (b'def') will *not* produce b'abc def', but rather will produce b'abc b\'def\'' (because str(b'def'') is "b'def'"). If that's what you're saying, then fine, but it's a different PEP and I for one am -1 specifically because of the behaviour I show above. Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com