[Python-Dev] summary of transitioning from % to {} formatting

MRAB python at mrabarnett.plus.com
Sat Oct 3 19:14:03 CEST 2009


Mark Dickinson wrote:
> On Sat, Oct 3, 2009 at 4:41 PM, Steven Bethard <steven.bethard at gmail.com> wrote:
>> I thought it might be useful for those who don't have time to read a
>> million posts to have a summary of what's happened in the formatting
>> discussion.
> 
> Definitely useful.  Thanks for the summary!
> 
> [...]
> 
>> * Add a parameter which declares the type of format string::
>>    logging.Formatter(fmt="{asctime} - {name}", format=BRACES)
>>  The API code would then switch between %-format and {}-format
>>  based on the value of that parameter. If %-formatting is to be
>>  deprecated, this could be done by first deprecating
>>  format=PERCENTS and requiring format=BRACES, and then changing the
>>  default to format=BRACES.
> 
> +1.
[snip]
'fmt' (which is an abbreviation for 'format') and 'format'? Maybe 'fmt'
and 'style' instead?


More information about the Python-Dev mailing list