GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131507: Add support for syntax highlighting in PyREPL by ambv · Pull Request #131562 · python/cpython

Conversation

@ambv

@ambv ambv commented Mar 21, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Syntax highlighting in PyREPL #131507

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

neutrinoceros reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@ambv
pythongh-131507: Add support for syntax highlighting in PyREPL
35f01ca
@ambv
ambv requested review from lysnikolaou and pablogsal as code owners March 21, 2025 18:00
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 21, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 21, 2025
Syntax highlighting in PyREPL #131507
Closed
@ambv
Add Blurb
ff14653
@ambv ambv mentioned this pull request Mar 21, 2025
Add support for syntax highlighting in PyREPL ambv/cpython#89
Closed
Wulian233
Wulian233 reviewed Mar 22, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py
import unicodedata
import functools

from idlelib import colorizer

@Wulian233 Wulian233 Mar 22, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/_pyrepl/utils.py
import functools

from idlelib import colorizer
from typing import cast, Iterator, Literal, Match, NamedTuple, Pattern, Self

@Wulian233 Wulian233 Mar 22, 2025

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Viicos
Viicos reviewed Mar 22, 2025
View reviewed changes
Comment thread Lib/_pyrepl/utils.py
Comment on lines +20 to +27
type ColorTag = (
Literal["KEYWORD"]
| Literal["BUILTIN"]
| Literal["COMMENT"]
| Literal["STRING"]
| Literal["DEFINITION"]
| Literal["SYNC"]
)

@Viicos Viicos Mar 22, 2025

Copy link
Copy Markdown
Contributor

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.

Suggested change
type ColorTag = (
Literal["KEYWORD"]
| Literal["BUILTIN"]
| Literal["COMMENT"]
| Literal["STRING"]
| Literal["DEFINITION"]
| Literal["SYNC"]
)
type ColorTag = Literal["KEYWORD", "BUILTIN", "COMMENT", "STRING", "DEFINITION", "SYNC"]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ambv
Fix irrelevant Windows tests
75cd06d
@ambv
ambv force-pushed the pyrepl-syntax-highlighting branch from f4bd10f to 75cd06d Compare March 22, 2025 12:36
@tomasr8 tomasr8 mentioned this pull request Apr 12, 2025
gh-131952: Add color to the json CLI #132126
Merged
@tomasr8

tomasr8 commented Apr 19, 2025

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv ambv closed this May 1, 2025
@ambv ambv mentioned this pull request May 1, 2025
gh-131507: Add support for syntax highlighting in PyREPL #133247
Merged
@ambv
ambv deleted the pyrepl-syntax-highlighting branch May 3, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
2 more reviewers
@Viicos Viicos Viicos left review comments
@Wulian233 Wulian233 Wulian233 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@ambv @tomasr8 @Viicos @Wulian233
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.