[Python-checkins] CVS: python/dist/src/Doc/ref reswords.py,1.1,1.2
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 04 Dec 2001 12:39:38 -0800
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv24963
Modified Files:
reswords.py
Log Message:
Import the keyword module instead of relying on our own list of
reserved words. No longer need to import string.
Index: reswords.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/reswords.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** reswords.py 1997/05/08 23:21:48 1.1
--- reswords.py 2001/12/04 20:39:36 1.2
***************
*** 1,19 ****
"""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
! """
ncols = 5
def main():
! words = string.split(raw_words)
words.sort()
colwidth = 1 + max(map(len, words))
--- 1,10 ----
"""Spit out the Python reserved words table."""
! import keyword
ncols = 5
def main():
! words = keyword.kwlist[:]
words.sort()
colwidth = 1 + max(map(len, words))