Message341283
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? |
|
Date |
User |
Action |
Args |
2019-05-02 16:30:53 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gregory.p.smith, eric.smith, steven.daprano, dirn, xtreak |
2019-05-02 16:30:53 | serhiy.storchaka | set | messageid: <1556814653.33.0.0157819227396.issue36774@roundup.psfhosted.org> |
2019-05-02 16:30:53 | serhiy.storchaka | link | issue36774 messages |
2019-05-02 16:30:52 | serhiy.storchaka | create | |
|