Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
To implement converting printf-style string formatting into f-string expressions (see issue28307) I need to add new convertors: 'd': int(x) where x is a number, used for %d, %u, %i 'i': operator.index(i), used for %x, %o, %b 'f': float(x) where x is a number, used for %f, %g, %e They may be private, only exposed in the AST between optimizer and code generator. But they can also be supported by Python grammar and str.format() if there is a use case for this. If 'd' be used for other purposes, I will need to find other character for converting a number to integer (with possible truncation). Any suggestions? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36774> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com