-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-144207: Syntax highlighting (theming support) for dis module #144208
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
Open
AbduazizZiyodov
wants to merge
16
commits into
python:main
Choose a base branch
from
Abduaziz-Forks:dis-theme-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1e0b1ab
Add support for syntax highlighting(via themes).
AbduazizZiyodov 468e561
Set NO_COLOR to 1 for test_compiler_assemble & test_dis test cases, b…
AbduazizZiyodov 9b637d1
Merge branch 'main' into dis-theme-support
AbduazizZiyodov 4067c9b
Replace NO_COLOR=1 trick with `@force_not_colorized*` helpers
AbduazizZiyodov f3a0d2e
Move `Dis` to top, keep alphabetical order
AbduazizZiyodov a87f3cf
Revert unrelated(type annotation) change(s)
AbduazizZiyodov 71c37a1
re-add removed line, remove(revert) return type annotation
AbduazizZiyodov 3e9a547
Wrap long lines
AbduazizZiyodov 9310e30
Update What's new section, add news entry
AbduazizZiyodov 8d389be
Make get_dis_theme protected function
AbduazizZiyodov f9ede48
Update Doc/whatsnew/3.15.rst
AbduazizZiyodov 103124d
Wrap lines, refer to proper documentation section for controlling color
AbduazizZiyodov 9284ae4
Merge branch 'main' into dis-theme-support
AbduazizZiyodov 7ed9c9e
Remove unused link
AbduazizZiyodov 023fcf7
Merge branch 'python:main' into dis-theme-support
AbduazizZiyodov 19436ee
feat: minimize use of colors, emphasis on load/pop, update theme acco…
AbduazizZiyodov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add tests for the colouration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Library/2026-01-25-15-26-23.gh-issue-144207.G2c_qd.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| :func:`dis.dis` supports colored output by default which can also be | ||
| :ref:`controlled <using-on-controlling-color>` through ``NO_COLOR=1`` | ||
| environment variable. Contributed by Abduaziz Ziyodov. |
Oops, something went wrong.
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.
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.
I am a bit confused with END_FOR and END_ASYNC_FOR being colored differently but I do not remember the exact effect of the latter.
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.
I've read that
END_FORis equivalent(or alias I would say) toPOP_TOP:and it is specified under "General instructions" section while
END_ASYNC_FORin "Coroutine opcodes" (I generalized this into "control flow" opcodes).Almost all opcodes are dealing with stack, but
END_ASYNC_FORis putting little more effort thanEND_FORwhich is just stack.pop(), that's why I thoughtEND_ASYNC_FORis different thanEND_FOR.That's my understanding.
We might elaborate our discussion on categories in your next comment too.