Message341262
On Thu, May 02, 2019 at 11:40:45AM +0000, Eric V. Smith wrote:
>
> New submission from Eric V. Smith <eric@trueblade.com>:
>
> I originally propsed this here: https://mail.python.org/pipermail/python-ideas/2018-October/053956.html, and there has also been some discussion on discourse.
>
> The proposal is to add a !d "type conversion" to f-strings, to make for simpler "print-based debugging". The idea is that !d would be like !r, etc., except that the resulting string would be:
>
> - the text of the expression, followed by
> - an equal sign, followed by
> - the value of the expression
I don't want to see this added as a special case to f-strings. I think
there are enough use-cases for having access to expressions, complete
with source code, as first-class values to make this a general feature
of the language and not baked into f-strings. I have a proto-PEP
discussing this.
> I have a patch almost ready.
Please don't limit this useful feature to f-strings. "Debugging strings"
only scratches the surface of what this could be useful for. |
|
Date |
User |
Action |
Args |
2019-05-02 12:05:43 | steven.daprano | set | recipients:
+ steven.daprano, eric.smith |
2019-05-02 12:05:43 | steven.daprano | link | issue36774 messages |
2019-05-02 12:05:43 | steven.daprano | create | |
|