Feature or enhancement
Make pprint.pprint() use the terminal width if available.
Pitch
Currently pprint.pprint() and other methods have a default width argument of 80. If you use are debugging on a terminal wider than that then your output is often needlessly split across lines.
You can of course remember to pass width=some_bigger_number each time, but then if you're shifting your terminal size as you're debugging then you need to keep adjusting it. It's a bit annoying.
Let's just use the terminal width, if available, and fall back to the current default of 80 if not?
Previous discussion
https://discuss.python.org/t/the-pprint-module-should-use-the-terminal-width-where-available/27658
Linked PRs
Feature or enhancement
Make
pprint.pprint()use the terminal width if available.Pitch
Currently
pprint.pprint()and other methods have a defaultwidthargument of80. If you use are debugging on a terminal wider than that then your output is often needlessly split across lines.You can of course remember to pass
width=some_bigger_numbereach time, but then if you're shifting your terminal size as you're debugging then you need to keep adjusting it. It's a bit annoying.Let's just use the terminal width, if available, and fall back to the current default of
80if not?Previous discussion
https://discuss.python.org/t/the-pprint-module-should-use-the-terminal-width-where-available/27658
Linked PRs