Python 3.5, bytes, and %-interpolation (aka PEP 461)

Ethan Furman ethan at stoneleaf.us
Mon Feb 24 16:53:03 EST 2014


On 02/24/2014 01:04 PM, random832 at fastmail.us wrote:
> On Mon, Feb 24, 2014, at 15:46, Marko Rauhamaa wrote:
>> That is:
>>
>>   1. ineffient (encode/decode shuffle)
>>
>>   2. unnatural (strings usually have no place in protocols)
>
> That's not at all clear. Why _aren't_ these protocols considered text
> protocols? Why can't you add a string directly to headers?

Because text is a high-order abstraction.  You don't store text in files, you don't transmit text over the wire or 
through the air -- those actions are done with a lower abstraction, that of bytes.

You're framework may allow you to add a string, but under the covers it's converting to bytes -- at which point is up to 
the framework.

--
~Ethan~



More information about the Python-list mailing list