summaryrefslogtreecommitdiffstats
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-02 00:40:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-02 00:40:05 (GMT)
commitf13eb55d59d80907c9f86574ddd23bce2cb41ff3 (patch)
tree799ffe8a95c5cacd946f186f3022f380b418141d /Lib/sre_parse.py
parent1931ca72b5769ee686776617e2d97d839cc7d2d6 (diff)
downloadcpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.zip
cpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.tar.gz
cpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.tar.bz2
Replace boolean test with is None.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r--Lib/sre_parse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index a5a8831..1b52967 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -80,7 +80,7 @@ class Pattern:
def opengroup(self, name=None):
gid = self.groups
self.groups = gid + 1
- if name:
+ if name is not None:
ogid = self.groupdict.get(name, None)
if ogid is not None:
raise error, ("redefinition of group name %s as group %d; "
@@ -97,7 +97,7 @@ class SubPattern:
# a subpattern, in intermediate form
def __init__(self, pattern, data=None):
self.pattern = pattern
- if not data:
+ if data is None:
data = []
self.data = data
self.width = None