FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-152056: Compile single-category character sets to a bare CATEGORY opcode by eendebakpt · Pull Request #152057 · python/cpython · GitHub

Repository navigation

gh-152056: Compile single-category character sets to a bare CATEGORY opcode - #152057

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
eendebakpt:re-single-category-set
Jun 24, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
eendebakpt:re-single-category-set

Conversation

eendebakpt commented Jun 24, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

A character set containing exactly one category, e.g. [\d] or [^\s], now compiles to a single CATEGORY opcode (like \d or \S) instead of an IN block. This speeds up matching and reduces the size of the compiled byte code.
See the issue for details.

A character set containing exactly one category, e.g. [\d] or [^\s], now
compiles to a single CATEGORY opcode (like \d or \S) instead of an IN
block.  The negated form maps to the complementary category.  This speeds
up matching and reduces the size of the compiled byte code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. I updated NEWS/What's New to match the previous commit.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33287767 | 📁 Comparing f95141e against main (a46db4f)

  🔍 Preview build  

2 files changed
± whatsnew/3.16.html
± whatsnew/changelog.html

serhiy-storchaka merged commit 21c4b73 into python:main Jun 24, 2026
58 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL