diff options
author | Raymond Hettinger <python@rcn.com> | 2010-09-05 23:15:06 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-09-05 23:15:06 (GMT) |
commit | d5825ccd404a61a08fd3211a41eb30baa27e2dfd (patch) | |
tree | 635ca6a288238cebd2959290fc8a8b508233db70 /Lib/_markupbase.py | |
parent | 0d739d70471cafdea04d9624cbfb7895b7d1b566 (diff) | |
download | cpython-d5825ccd404a61a08fd3211a41eb30baa27e2dfd.zip cpython-d5825ccd404a61a08fd3211a41eb30baa27e2dfd.tar.gz cpython-d5825ccd404a61a08fd3211a41eb30baa27e2dfd.tar.bz2 |
Take advantage of the frozenset constant optimization.
Diffstat (limited to 'Lib/_markupbase.py')
-rw-r--r-- | Lib/_markupbase.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/_markupbase.py b/Lib/_markupbase.py index adf6ba2..98b9037 100644 --- a/Lib/_markupbase.py +++ b/Lib/_markupbase.py @@ -122,7 +122,7 @@ class ParserBase: # this could be handled in a separate doctype parser if decltype == "doctype": j = self._parse_doctype_subset(j + 1, i) - elif decltype in ("attlist", "linktype", "link", "element"): + elif decltype in {"attlist", "linktype", "link", "element"}: # must tolerate []'d groups in a content model in an element declaration # also in data attribute specifications of attlist declaration # also link type declaration subsets in linktype declarations @@ -145,10 +145,10 @@ class ParserBase: sectName, j = self._scan_name( i+3, i ) if j < 0: return j - if sectName in ("temp", "cdata", "ignore", "include", "rcdata"): + if sectName in {"temp", "cdata", "ignore", "include", "rcdata"}: # look for standard ]]> ending match= _markedsectionclose.search(rawdata, i+3) - elif sectName in ("if", "else", "endif"): + elif sectName in {"if", "else", "endif"}: # look for MS Office ]> ending match= _msmarkedsectionclose.search(rawdata, i+3) else: @@ -203,7 +203,7 @@ class ParserBase: name, j = self._scan_name(j + 2, declstartpos) if j == -1: return -1 - if name not in ("attlist", "element", "entity", "notation"): + if name not in {"attlist", "element", "entity", "notation"}: self.updatepos(declstartpos, j + 2) self.error( "unknown declaration %r in internal subset" % name) |