-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-131507: Add support for syntax highlighting in PyREPL #131562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ambv
commented
Mar 21, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Syntax highlighting in PyREPL #131507
@@ -2,12 +2,56 @@ | |||
import unicodedata | |||
import functools | |||
|
|||
from idlelib import colorizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from idlelib import colorizer
On Windows, if you do not choose to install Tcl/Tk, IDLE will not be available
See https://github.com/python/cpython/blob/main/Tools%2Fmsi%2Ftcltk%2Ftcltk.wixproj
@@ -2,12 +2,56 @@ | |||
import unicodedata | |||
import functools | |||
|
|||
from idlelib import colorizer | |||
from typing import cast, Iterator, Literal, Match, NamedTuple, Pattern, Self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some deprecated aliases. Although there are no issues at present, it would be better to switch to collection.abc
https://docs.python.org/3.14/library/typing.html#typing.Iterator
type ColorTag = ( | ||
Literal["KEYWORD"] | ||
| Literal["BUILTIN"] | ||
| Literal["COMMENT"] | ||
| Literal["STRING"] | ||
| Literal["DEFINITION"] | ||
| Literal["SYNC"] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type ColorTag = ( | |
Literal["KEYWORD"] | |
| Literal["BUILTIN"] | |
| Literal["COMMENT"] | |
| Literal["STRING"] | |
| Literal["DEFINITION"] | |
| Literal["SYNC"] | |
) | |
type ColorTag = Literal["KEYWORD", "BUILTIN", "COMMENT", "STRING", "DEFINITION", "SYNC"] |
f4bd10f
to
75cd06d
Compare
Here's what it looks like with the default Ubuntu dark/light themes: ![]() ![]() The contrast of the blue color seems a bit too low for the dark theme (I had the same issue in #132126). Maybe the 'intense' variant might look better? |