[Python-ideas] Binary f-strings

Sven R. Kunze srkunze at mail.de
Mon Oct 5 08:59:39 CEST 2015


On 03.10.2015 21:18, Eric V. Smith wrote:
> On 10/03/2015 12:20 PM, Steve Dower wrote:
>> "Something else that's neat with this: you could use the struct module
>> for more complex subsections of a binary protocol"
>>
>> Personally, if binary f-strings did struct packing by default, I'd want
>> to use them all the time.
> That appeals to me, too. There are a number of practical problems that
> would need to be worked out. We can argue those later :)

I think that's were I reach the limit of my "binary" experience in 
Python. But if people (here Steve) found it useful, why not? If there 
are problems that cannot be solved easily, we can do a V1 and later a V2 
that includes the struct packing.

> I guess it comes down to: what would the commonest use case for
> fb-strings be?

To me, it's the same as for all f-strings: the bloody easy string 
concatenation of easily distinguishable parts.

I even have to admit I thought they were called *format strings* because 
they *give format/structure* to the resulting string. Well, now I know 
better (format refers to the formatting of the input expressions) but 
the analogy is still in my mind.

> My other concern is non-ascii chars inside the braces in an fb-string.

What's wrong with them?


Best,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151005/38dc545e/attachment-0001.html>


More information about the Python-ideas mailing list