Message393740
PR 26160 adds support of %d, %i, %u, %o, %x, %X, %f, %e, %g, %F, %E, %G.
What is not supported:
* Formatting with a single value not wrapped into a 1-tuple (like in "%d bytes" % size). The behavior is non-trivial, it needs checking whether the value is a tuple or a mapping. It would require adding more opcodes and AST nodes and generating complex bytecode.
* Mapping keys (like in "%(name)s"). They are rarely used, and if used, it is not performance critical.
* Precision for integer formatting. Precision is not supported in new-style formatting of integers, and it is not trivial to reproduce this behavior.
* Variable width and precision (like in "%*.*s"). It is possible to support them, but the code would be pretty complex, and the benefit is small, because this feature is rarely used and is not performance critical.
* Format code %c. It is relatively rarely used.
* Length modifiers "h", "l" and "L" (like in "%ld"). They ignored in Python and I did not see them in real code. While supporting them is easy, it would requires adding more than one line of code, it is not worth it. |
|
Date |
User |
Action |
Args |
2021-05-16 11:50:56 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, taleinat, eric.smith, Mark.Shannon, ztane |
2021-05-16 11:50:56 | serhiy.storchaka | set | messageid: <1621165856.84.0.656841359056.issue28307@roundup.psfhosted.org> |
2021-05-16 11:50:56 | serhiy.storchaka | link | issue28307 messages |
2021-05-16 11:50:56 | serhiy.storchaka | create | |
|