]> granicus.if.org Git - python/commitdiff
Reduced number of temporary names used at module scope. Use underscores in
authorFred Drake <fdrake@acm.org>
Mon, 6 Oct 1997 21:28:04 +0000 (21:28 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 6 Oct 1997 21:28:04 +0000 (21:28 +0000)
front of temporary names in the module namespace.

Lib/token.py

index 61228e5762107b4ff55d75a80fe37a56c1026bad..3d358a3d7743f5dfdc39890ea6307cca9966baa6 100755 (executable)
@@ -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