GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — sre: the UCS2 and UCS4 variants of charset_loc_ignore are unreachable · Issue #160498 · python/cpython Open Labels extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-regextype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior) DescriptionSummary
EvidenceCoverage from a 78 lines that no input reaches. Why they cannot be reached
if flags & SRE_FLAG_IGNORECASE and flags & SRE_FLAG_LOCALE: emit(IN_LOC_IGNORE) and the parser refuses raise ValueError("cannot use LOCALE flag with a str pattern") The opcode is fixed when the pattern is compiled, so adding the flag later does import re, _sre from re import _parser, _compiler p = _parser.parse('[a-z]', re.IGNORECASE) code = _compiler._code(p, re.IGNORECASE) groupindex = p.state.groupdict indexgroup = [None] * p.state.groups for k, i in groupindex.items(): indexgroup[i] = k pat = _sre.compile('[a-z]', re.IGNORECASE | re.LOCALE, code, p.state.groups - 1, groupindex, tuple(indexgroup)) pat.search('\U0001d11eA') # matches, and still does not call the UCS4 variant Matching a QuestionIs the triplication intentional (the template is included and every function is I have not prepared a patch: this is a question about intent first. If the answer CPython versions tested onCPython main branch (3.16.0a1+) Operating systems tested onLinux Activity
MetadataMetadataAssigneesLabelsextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-regextype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior) ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| 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. |