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:
parent
25695282a5
commit
70ef8692a1
|
@ -46,11 +46,7 @@ kwlist = [
|
||||||
#--end keywords--
|
#--end keywords--
|
||||||
]
|
]
|
||||||
|
|
||||||
kwdict = {}
|
iskeyword = frozenset(kwlist).__contains__
|
||||||
for keyword in kwlist:
|
|
||||||
kwdict[keyword] = 1
|
|
||||||
|
|
||||||
iskeyword = kwdict.has_key
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
import sys, re
|
import sys, re
|
||||||
|
|
Loading…
Reference in New Issue