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-95555: Add the CATEGORY_UCD opcode and the simple enumerated properties by serhiy-storchaka · Pull Request #153023 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 4, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

First of four stacked PRs that complete \p{...} support with the properties backed by the Unicode Character Database, matched in C through a unicodedata capsule. This PR adds the machinery and the simplest tier: the enumerated properties stored as a single byte in the per-character record — Bidi_Class (bc), East_Asian_Width (ea), Grapheme_Cluster_Break (gcb) and Indic_Conjunct_Break (incb).

unicodedata exports the _ucd_re_CAPI capsule (the \N{...} precedent) and _ucd_re_info(), which lists the property selectors and value names. The parser resolves a property name and value to a selector and value index; the new CATEGORY_UCD opcode packs (negate, property, value) into one operand and is matched in C by sre_category_ucd(), which compares the index returned by the capsule. A negated single value is one charset item, so \P{bc=AL} composes inside a set.

The follow-up PRs add, in order: the numeric and binary properties (ccc, Bidi_Mirrored, Extended_Pictographic), the computed properties (Block, Decomposition_Type, Numeric_Type) and the remaining General_Category values and groups (Ll, Lo, M/P/S) with POSIX punct.

  • Issue: re should support \p{...} character properties #95555

Sorry, something went wrong.

Uh oh!

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

All reactions
@serhiy-storchaka @claude
pythongh-95555: Add the CATEGORY_UCD opcode and the simple enumerated…
0b5410f
… properties

Introduce the unicodedata capsule used to match \p{...} properties that need
the Unicode Character Database, starting with the simplest tier: the
enumerated properties stored as a single byte in the per-character record --
Bidi_Class (bc), East_Asian_Width (ea), Grapheme_Cluster_Break (gcb) and
Indic_Conjunct_Break (incb).

unicodedata exports the _ucd_re_CAPI capsule (the \N{...} precedent) and
_ucd_re_info(), which lists the property selectors and value names.  The new
CATEGORY_UCD opcode packs (negate, property, value) and is matched in C by
sre_category_ucd().  A negated single value is one charset item, so \P{bc=AL}
composes inside a set.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@bedevere-app bedevere-app Bot mentioned this pull request Jul 4, 2026
re should support \p{...} character properties #95555
Open
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 4, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 4, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33446828 | 📁 Comparing 3d4e93a against main (cfe3e07)

  🔍 Preview build  

11 files changed · ± 11 modified

± Modified

  • library/dialog.html
  • library/http.cookiejar.html
  • library/http.server.html
  • library/imaplib.html
  • library/internet.html
  • library/re.html
  • library/tkinter.html
  • library/tkinter.ttk.html
  • reference/compound_stmts.html
  • whatsnew/3.16.html
  • and 1 more...
All reactions

Sorry, something went wrong.

Uh oh!

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

@serhiy-storchaka @claude
pythongh-95555: Register the RE capsule globals for the C-globals check
3d4e93a
The CATEGORY_UCD support adds three process-global tables that are set
once and effectively constant: the cached capsule pointer in
sre_category_ucd(), the capsule struct built by unicodedata_create_re_capi(),
and the enumerated-property table in unicodedata_ucd_re_info().  List them
in the c-analyzer ignore file, as done for the name-lookup capsule.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@serhiy-storchaka
serhiy-storchaka requested a review from ericsnowcurrently as a code owner July 5, 2026 12:57
@soreavis soreavis mentioned this pull request Jul 19, 2026
New sequences for Unicode groups and block ranges needed #43715
Closed
@fedonman fedonman mentioned this pull request Aug 10, 2026
\p{Alphabetic} matches gc=L, not the Unicode Alphabetic property #155498
Open
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Oct 5, 2026
@ambv

ambv commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

This PR is superseded by #156490, a newer open pull request for the same issue (gh-95555), and it no longer merges cleanly. Closing to cull the number of open pull requests. Do not reopen this pull request without getting a go-ahead from a triager or core developer.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ambv ambv closed this Oct 20, 2026
@ambv ambv reopened this Oct 21, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
@ambv

ambv commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Reopening, incorrectly closed as a duplicate.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting core review type-feature A feature request or enhancement

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.

2 participants

@serhiy-storchaka @ambv
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.