summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-12-04 20:39:36 (GMT)
committerGuido van Rossum <guido@python.org>2001-12-04 20:39:36 (GMT)
commit4ed6be710752a6f61f16170b1f5198263da1429b (patch)
tree1858501d74860cc605383e01c711c0b3a3f43366
parent41c6719fe4505f0f2303ce8b0c1edd1818e0a207 (diff)
downloadcpython-4ed6be710752a6f61f16170b1f5198263da1429b.zip
cpython-4ed6be710752a6f61f16170b1f5198263da1429b.tar.gz
cpython-4ed6be710752a6f61f16170b1f5198263da1429b.tar.bz2
Import the keyword module instead of relying on our own list of
reserved words. No longer need to import string.
-rw-r--r--Doc/ref/reswords.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/Doc/ref/reswords.py b/Doc/ref/reswords.py
index 22c3bb8..29f326f 100644
--- a/Doc/ref/reswords.py
+++ b/Doc/ref/reswords.py
@@ -1,20 +1,11 @@
"""Spit out the Python reserved words table."""
-import string
-
-raw_words = """
-and del for is raise
-assert elif from lambda return
-break else global not try
-class except if or while
-continue exec import pass
-def finally in print
-"""
+import keyword
ncols = 5
def main():
- words = string.split(raw_words)
+ words = keyword.kwlist[:]
words.sort()
colwidth = 1 + max(map(len, words))
nwords = len(words)