[Python-Dev] PEP 460 reboot

Ethan Furman ethan at stoneleaf.us
Mon Jan 13 20:05:13 CET 2014


On 01/13/2014 09:12 AM, Nick Coghlan wrote:
> On 14 January 2014 01:54, Ethan Furman wrote:
>>
>> Forgive me for being dense, but I don't understand your objection.  With
>> Guido's proposal, '%s' % bytes_data, bytes_data is passed through unchanged.
>> Did you mean something else by "binary data"?
>
> I mean it will work, but it will mean you've introduced an implicit
> assumption of ASCII compatibility into the structure your program

Okay, I'm still trying to understand.  Apparently we both mean the same thing by binary data / bytes, so the difference 
must be the %s, yes?  And the concern as that because you have used %s as the format code, if somebody accidentally put, 
say, "stupid bug" on the RHS you would end up with b"'stupid bug'" instead of an exception, which you get if you had 
used %b instead.  Am I following?

--
~Ethan~


More information about the Python-Dev mailing list