mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Import the keyword module instead of relying on our own list of
reserved words. No longer need to import string.
This commit is contained in:
parent
41c6719fe4
commit
4ed6be7107
1 changed files with 2 additions and 11 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue