summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1997-10-06 21:28:04 (GMT)
committerFred Drake <fdrake@acm.org>1997-10-06 21:28:04 (GMT)
commite3dbc7e42269613fee01a323bbe5d23584ed3ba3 (patch)
treedf1fa4b75f0df9f5c4d4bf85ffba3c7f3d09ade4 /Lib
parent00eb96a1263924729d097fc64db4e2e2873c6e3a (diff)
downloadcpython-e3dbc7e42269613fee01a323bbe5d23584ed3ba3.zip
cpython-e3dbc7e42269613fee01a323bbe5d23584ed3ba3.tar.gz
cpython-e3dbc7e42269613fee01a323bbe5d23584ed3ba3.tar.bz2
Reduced number of temporary names used at module scope. Use underscores in
front of temporary names in the module namespace.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/token.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/token.py b/Lib/token.py
index 61228e5..3d358a3 100755
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -56,12 +56,11 @@ N_TOKENS = 39
NT_OFFSET = 256
#--end constants--
-names = dir()
tok_name = {}
-for name in names:
- number = eval(name)
- if type(number) is type(0):
- tok_name[number] = name
+for _name, _value in globals().items():
+ if type(_value) is type(0):
+ tok_name[_value] = _name
+
def ISTERMINAL(x):
return x < NT_OFFSET