A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-January/131292.html below:

[Python-Dev] PEP 460: allowing %d and %f and mojibake

[Python-Dev] PEP 460: allowing %d and %f and mojibake [Python-Dev] PEP 460: allowing %d and %f and mojibakePaul Moore p.f.moore at gmail.com
Sun Jan 12 18:04:20 CET 2014
On 12 January 2014 16:52, Kristján Valur Jónsson <kristjan at 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4