Serhiy Storchaka added the comment:

'%s' % x should be translated to f'{x!s}', not to f'{x:s}'. Only %s, %r and %a 
can be supported. Formatting with %i should left untranslated. Or maybe 
translate '%r: %i' % (a, x) to f'{a!r}: {"%i" % x}'.

It is possible also to introduce special opcodes that converts argument to 
exact int or float. Then '%06i' % x could be translated to 
f'{__exact_int__(x):06}'.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28307>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to