Skip to content

Colorful pprint #160466

Open
Open

Description

@ZeroIntensity

Feature or enhancement

What's better than a pretty print? A colorful pretty print!
By extracting the syntax highlighting code from the REPL, we can get the same colorization for literals in the pprint module.

I had Codex make me an example, and it works pretty nicely:

Image

This will likely conflict with the PEP 813 reference implementation, so I'm going to keep the PR as a draft for now.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

Discussed at the sprint

Linked PRs

Activity

  1. added
    type-featureA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directory
    on Oct 23, 2026
  2. StanFromIreland commented on Oct 23, 2026

    @StanFromIreland
    Member

    This is a duplicate of #145217, no?

  3. hugovk commented on Oct 23, 2026

    @hugovk
    Member

    Yes, I think the issue is a duplicate, but my PR has stalled so I welcome a new attempt!

    Do have a read through the comments on my PR and check the blockers are addressed or not relevant in your approach (I've not looked yet).

  4. ZeroIntensity commented on Oct 23, 2026

    @ZeroIntensity
    MemberAuthor

    Ah, I thought the idea sounded familiar! I'll take a look at your PR.

  5. warsaw commented on Oct 24, 2026

    @warsaw
    Member

    Let's think about this in relation to the PEP 813 work.

  6. ZeroIntensity commented on Oct 24, 2026

    @ZeroIntensity
    MemberAuthor

    Yeah, I don't plan on marking the PR as non-draft until a decision is made on PEP 813.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

sprintstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

  • Status
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions