[Python-ideas] Briefer string format

Joseph Jevnik joejev at gmail.com
Mon Jul 20 02:02:40 CEST 2015


That is no better than: str.format(**locals(), **globals())

On Sun, Jul 19, 2015 at 8:00 PM, Sam O'Malley <omalsa04 at gmail.com> wrote:

> What about:
>
> csstext += '{nl}{key}{space}{nl}'.format()
>
> Format called with no arguments could default to reading from the locals
> dict.
> On Mon, 20 Jul 2015 at 9:22 am Terry Reedy <tjreedy at udel.edu> wrote:
>
>> On 7/19/2015 7:12 PM, Mike Miller wrote:
>> > Have long wished python could format strings easily like bash or perl
>> > do, ...
>> > and then it hit me:
>> >
>> >      csstext += f'{nl}{selector}{space}{{{nl}'
>>
>> Are the unbalanced braces here and in the followup intentional?
>>
>>
>> --
>> Terry Jan Reedy
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150719/e817ea33/attachment.html>


More information about the Python-ideas mailing list