[issue28904] add more format conversion flags eg. "len" and "id"

2016-12-08 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: fixed -> rejected stage: -> resolved ___ Python tracker ___

[issue28904] add more format conversion flags eg. "len" and "id"

2016-12-08 Thread Samuel Colvin
Samuel Colvin added the comment: I see, I hadn't appreciated fstrings where entirely different and more powerful than format(), I'll close this. For anyone else coming to this, with fstrings in >=3.6 you can do: In [4]: value = [1,2, 3] In [5]: f'The value is {value}.' Out[5]: 'The value is

[issue28904] add more format conversion flags eg. "len" and "id"

2016-12-08 Thread R. David Murray
R. David Murray added the comment: Thanks for the idea, but I think we're going to see a shift away from format calls and toward fstrings, so I don't think this is worth doing. See https://www.python.org/dev/peps/pep-0498/#id45; the ! expressions are only supported by fstrings only for

[issue28904] add more format conversion flags eg. "len" and "id"

2016-12-08 Thread Samuel Colvin
Samuel Colvin added the comment: I know contributing to python is currently a pain (bring on github!) but I'd be happy to attempt a patch if others agree this would be useful. -- ___ Python tracker

[issue28904] add more format conversion flags eg. "len" and "id"

2016-12-08 Thread Samuel Colvin
New submission from Samuel Colvin: (The "Components" selection might be wrong, I wasn't sure what to use) As https://docs.python.org/3.6/library/string.html > Three conversion flags are currently supported: '!s' which calls str() on the > value, '!r' which calls repr() and '!a' which calls