Author Charles Machalow
Recipients Charles Machalow
Date 2020-07-16.04:17:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594873061.38.0.656587142662.issue41312@roundup.psfhosted.org>
In-reply-to
Content
Right now in str.format(), we have !s, !r, and !a to allow us to call str(), repr(), and ascii() respectively on the given expression.

I'm proposing that we add a !p conversion to have pprint.pformat() be called to convert the given expression to a 'pretty' string.

Calling
```
print(f"My dict: {d!p}")
```

is a lot more concise than:

```
import pprint
print(f"My dict: {pprint.pformat(d)}")
```

We may even be able to have a static attribute stored to change the various default kwargs of pprint.pformat().
History
Date User Action Args
2020-07-16 04:17:41Charles Machalowsetrecipients: + Charles Machalow
2020-07-16 04:17:41Charles Machalowsetmessageid: <1594873061.38.0.656587142662.issue41312@roundup.psfhosted.org>
2020-07-16 04:17:41Charles Machalowlinkissue41312 messages
2020-07-16 04:17:40Charles Machalowcreate