mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-34681: Rename class Pattern in sre_parse to State. (GH-9310)
Also rename corresponding attributes, parameters and variables.
This commit is contained in:
parent
9c53fa6ad9
commit
e0c19ddc66
3 changed files with 26 additions and 26 deletions
|
|
@ -597,7 +597,7 @@ def isstring(obj):
|
|||
|
||||
def _code(p, flags):
|
||||
|
||||
flags = p.pattern.flags | flags
|
||||
flags = p.state.flags | flags
|
||||
code = []
|
||||
|
||||
# compile info block
|
||||
|
|
@ -772,13 +772,13 @@ def compile(p, flags=0):
|
|||
dis(code)
|
||||
|
||||
# map in either direction
|
||||
groupindex = p.pattern.groupdict
|
||||
indexgroup = [None] * p.pattern.groups
|
||||
groupindex = p.state.groupdict
|
||||
indexgroup = [None] * p.state.groups
|
||||
for k, i in groupindex.items():
|
||||
indexgroup[i] = k
|
||||
|
||||
return _sre.compile(
|
||||
pattern, flags | p.pattern.flags, code,
|
||||
p.pattern.groups-1,
|
||||
pattern, flags | p.state.flags, code,
|
||||
p.state.groups-1,
|
||||
groupindex, tuple(indexgroup)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue