-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Add colour to pprint output #145217
Copy link
Copy link
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Feature or enhancement
Proposal:
We can use the existing
syntaxtheme to add colour to the output of:pprint.pp(data)pprint.pprint(data)pprint.PrettyPrinter().pprint(data)cpython/Lib/_colorize.py
Lines 312 to 323 in 9b22261
As usual, this will respect the environment variables to control colour and the output stream's capabilities.
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:
No response
Linked PRs
pprintoutput #145218