This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients eric.smith, steven.daprano
Date 2019-05-02.12:05:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20190502120536.GC5010@ando.pearwood.info>
In-reply-to <1556797245.95.0.619255948077.issue36774@roundup.psfhosted.org>
Content
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.
History
Date User Action Args
2019-05-02 12:05:43steven.dapranosetrecipients: + steven.daprano, eric.smith
2019-05-02 12:05:43steven.dapranolinkissue36774 messages
2019-05-02 12:05:43steven.dapranocreate