prettyprinter
prettyprinter copied to clipboard
Formatting of dict keys depends on the length of the corresponding value
- PrettyPrinter version: 0.17
- Python version: 38
- Operating System: linux
Description
As in the title.
What I Did
from prettyprinter import pprint
pprint({
(1, 2, 3):
"short string",
(4, 5, 6):
"a really long string, if you see what I mean, just padding it for "
"the sake of it",
})
outputs
{
(1, 2, 3): 'short string',
(
4,
5,
6
):
'a really long string, if you see what I mean, just padding it for '
'the sake of it'
}
I would argue that a single-line-printable key should not be forced use to multiline output even if the value needs multiline output (in other words, the layout in the source seems more legible to me).