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

Use a set instead of dict with values equal to one.
This commit is contained in:
Raymond Hettinger 2003-12-02 07:48:15 +00:00
parent 25695282a5
commit 70ef8692a1
1 changed files with 1 additions and 5 deletions

View File

@ -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