From: Guido van Rossum Date: Thu, 20 Mar 1997 19:44:30 +0000 (+0000) Subject: Simple module to publish list of Python keywords. X-Git-Tag: v1.5a1~273 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90d556fb6e71ca05b14c514b0c9a53a99839a3e0;p=python Simple module to publish list of Python keywords. --- diff --git a/Lib/keyword.py b/Lib/keyword.py new file mode 100755 index 0000000000..acee8ff775 --- /dev/null +++ b/Lib/keyword.py @@ -0,0 +1,37 @@ +"""Export the list of Python keywords (reserved words).""" + +# grep '{1, "' ../Python/graminit.c | sed 's/.*"\(.*\)".*/ "\1",/' | sort + +keywords = [ + "__assert__", + "and", + "break", + "class", + "continue", + "def", + "del", + "elif", + "else", + "except", + "exec", + "finally", + "for", + "from", + "global", + "if", + "import", + "in", + "is", + "lambda", + "not", + "or", + "pass", + "print", + "raise", + "return", + "try", + "while", + ] + +if __name__ == '__main__': + for k in keywords: print k