summaryrefslogtreecommitdiff
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-11 21:13:28 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-11 21:13:28 +0200
commitab14088141ab749763e35b7a49e79c368940e12d (patch)
tree0369f9a136bfea659c24b0cf9fedf2ee98272308 /Lib/sre_parse.py
parent9a64ccb997a99f85c2538047823c7478bfcff6ed (diff)
downloadcpython-git-ab14088141ab749763e35b7a49e79c368940e12d.tar.gz
Minor code clean up and improvements in the re module.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r--Lib/sre_parse.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index aa2d64bb40..45411f89f1 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -103,18 +103,18 @@ class SubPattern:
seqtypes = (tuple, list)
for op, av in self.data:
print(level*" " + str(op), end='')
- if op == IN:
+ if op is IN:
# member sublanguage
print()
for op, a in av:
print((level+1)*" " + str(op), a)
- elif op == BRANCH:
+ elif op is BRANCH:
print()
for i, a in enumerate(av[1]):
if i:
print(level*" " + "OR")
a.dump(level+1)
- elif op == GROUPREF_EXISTS:
+ elif op is GROUPREF_EXISTS:
condgroup, item_yes, item_no = av
print('', condgroup)
item_yes.dump(level+1)
@@ -607,7 +607,7 @@ def _parse(source, state):
item = subpattern[-1:]
else:
item = None
- if not item or (_len(item) == 1 and item[0][0] == AT):
+ if not item or (_len(item) == 1 and item[0][0] is AT):
raise source.error("nothing to repeat",
source.tell() - here + len(this))
if item[0][0] in _REPEATCODES: