From e3dbc7e42269613fee01a323bbe5d23584ed3ba3 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 6 Oct 1997 21:28:04 +0000 Subject: Reduced number of temporary names used at module scope. Use underscores in front of temporary names in the module namespace. --- Lib/token.py | 9 ++++----- 1 file 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 -- cgit v0.12