gh-95555: Fix a stale comment about negating \P in a character class - #156490
Open
fedonman wants to merge 1 commit into
Open
gh-95555: Fix a stale comment about negating \P in a character class#156490fedonman wants to merge 1 commit into
fedonman wants to merge 1 commit into
Conversation
…class pythonGH-152245 lifted the restriction that a negated multi-range property could not appear inside a character class, and added assertions in test_property_escapes showing that [\P{ASCII}] and friends now match. It left in place an earlier comment in the same test saying that, unlike an engine category, \P of a multi-range property cannot be negated inside a character class. The distinction that remains is how the member is compiled, not whether it is allowed: an engine category joins the set directly as a CATEGORY, while a multi-range \P is alternated in as a separate branch.
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
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.
The comment above the
[\P{Alphabetic}]assertion intest_property_escapesstill says that, unlike an engine category,\Pof a multi-range property cannot be negated inside a character class. GH-152245 lifted that restriction, and the same test now asserts fifty lines below that[\P{ASCII}],[\P{ASCII}abc]and[^\P{ASCII}]all match. The comment now states the distinction that does remain, which is how the member is compiled rather than whether it is allowed:Comment-only change in a test file, so there is no news entry.
reshould support\p{...}character properties #95555