-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
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
Description
Feature or enhancement
Proposal:
We can use the existing syntax theme to add colour to the output of:
pprint.pp(data)pprint.pprint(data)pprint.PrettyPrinter().pprint(data)
Lines 312 to 323 in 9b22261
| class Syntax(ThemeSection): | |
| prompt: str = ANSIColors.BOLD_MAGENTA | |
| keyword: str = ANSIColors.BOLD_BLUE | |
| keyword_constant: str = ANSIColors.BOLD_BLUE | |
| builtin: str = ANSIColors.CYAN | |
| comment: str = ANSIColors.RED | |
| string: str = ANSIColors.GREEN | |
| number: str = ANSIColors.YELLOW | |
| op: str = ANSIColors.RESET | |
| definition: str = ANSIColors.BOLD | |
| soft_keyword: str = ANSIColors.BOLD_BLUE | |
| reset: str = ANSIColors.RESET |
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
Reactions are currently unavailable
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