Kaydet (Commit) 70ef8692 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

SF patch #852140: keyword.py - use __contains__ and bool

Use a set instead of dict with values equal to one.
üst 25695282
......@@ -46,11 +46,7 @@ kwlist = [
#--end keywords--
]
kwdict = {}
for keyword in kwlist:
kwdict[keyword] = 1
iskeyword = kwdict.has_key
iskeyword = frozenset(kwlist).__contains__
def main():
import sys, re
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment