Commit 8b0ee24e authored by Jack Jansen's avatar Jack Jansen

(Much) better list of Python keywords, supplied by Michael J. Barber.

parent c8febecd
...@@ -816,9 +816,11 @@ def compiledataflags(flags): ...@@ -816,9 +816,11 @@ def compiledataflags(flags):
bits.append(`i`) bits.append(`i`)
return '[%s]' % string.join(bits) return '[%s]' % string.join(bits)
# XXXX Do we have a set of python keywords somewhere? # Set of Python keywords (as of Python 2.2)
illegal_ids = [ "for", "in", "from", "and", "or", "not", "print", "class", "return", illegal_ids = ["and", "elif", "global", "or", "assert", "else", "if", "pass",
"def" ] "break", "except", "import", "print", "class", "exec", "in", "raise",
"continue", "finally", "is", "return", "def", "for", "lambda", "try",
"del", "from", "not", "while"]
def identify(str): def identify(str):
"""Turn any string into an identifier: """Turn any string into an identifier:
......
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