[Python-ideas] String interpolation for all literal strings
Eric V. Smith
eric at trueblade.com
Fri Aug 7 23:54:28 CEST 2015
On 8/7/2015 5:40 PM, Ron Adam wrote:
>
>
> On 08/07/2015 04:42 PM, Ron Adam wrote:
>>
>> def _(value, fmt=''):
>> ('{:%s}' % fmt).format(value)
>
> Hmmm, I notice that this can be rewritten as...
>
> _ = format
> 'abc' + _(expr1) + 'def' + _(expr2) + 'ghi'
>
>
> What surpised me is the docs say...
>
> format(format_string, *args, **kwargs)
Where do you see that?
https://docs.python.org/3/library/functions.html#format
Says: format(value[, format_spec])
Eric.
More information about the Python-ideas
mailing list