From 4ed6be710752a6f61f16170b1f5198263da1429b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 4 Dec 2001 20:39:36 +0000 Subject: Import the keyword module instead of relying on our own list of reserved words. No longer need to import string. --- Doc/ref/reswords.py | 13 ++----------- 1 file 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) -- cgit v0.12