]> granicus.if.org Git - python/commitdiff
(Much) better list of Python keywords, supplied by Michael J. Barber.
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 23 Jan 2002 22:49:48 +0000 (22:49 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 23 Jan 2002 22:49:48 +0000 (22:49 +0000)
Mac/scripts/gensuitemodule.py

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