[issue41312] add !p to pprint.pformat() in str.format() an f-strings

Raymond Hettinger report at bugs.python.org
Thu Jul 16 20:56:11 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

If the python-ideas discussion is fruitful, go ahead and re-open this tracker item.

Personally, I don't see how this would work.  The pretty printing routines rely on knowing their current level of indentation.  Also, much of the "prettiness" comes from making the output span multiple lines, so this wouldn't fit well in the middle of an f-string.  Lastly, the pprint module leaves a lot to be desired and likely needs a rewrite from scratch, so it wouldn't be wise to tie it directly to a core language feature.

----------
nosy: +rhettinger
resolution:  -> later
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41312>
_______________________________________


More information about the Python-bugs-list mailing list