bpo-34681: Rename class Pattern in sre_parse to State. (GH-9310)

Also rename corresponding attributes, parameters and variables.
This commit is contained in:
Serhiy Storchaka 2018-09-18 09:16:26 +03:00 committed by GitHub
parent 9c53fa6ad9
commit e0c19ddc66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 26 deletions

View file

@ -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)
)