summaryrefslogtreecommitdiffstats
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r--Lib/sre_parse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index d53d37c..99f33fc 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -101,7 +101,7 @@ class SubPattern:
self.width = None
def dump(self, level=0):
nl = 1
- seqtypes = type(()), type([])
+ seqtypes = (tuple, list)
for op, av in self.data:
print(level*" " + op, end=' '); nl = 0
if op == "in":
@@ -117,7 +117,7 @@ class SubPattern:
print(level*" " + "or")
a.dump(level+1); nl = 1
i = i + 1
- elif type(av) in seqtypes:
+ elif isinstance(av, seqtypes):
for a in av:
if isinstance(a, SubPattern):
if not nl: print()
@@ -709,7 +709,7 @@ def parse_template(source, pattern):
else:
pappend((LITERAL, literal))
sep = source[:0]
- if type(sep) is type(""):
+ if isinstance(sep, str):
makechar = chr
else:
makechar = chr