X Tutup
The Wayback Machine - https://web.archive.org/web/20250608072731/https://github.com/python/cpython/issues/105630
Skip to content

The pprint module should use the terminal width, where available #105630

Closed as not planned
@orf

Description

@orf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesstdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup