From: Fred Drake Date: Mon, 6 Oct 1997 21:28:04 +0000 (+0000) Subject: Reduced number of temporary names used at module scope. Use underscores in X-Git-Tag: v1.5a4~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3dbc7e42269613fee01a323bbe5d23584ed3ba3;p=thirdparty%2FPython%2Fcpython.git Reduced number of temporary names used at module scope. Use underscores in front of temporary names in the module namespace. --- diff --git a/Lib/token.py b/Lib/token.py index 61228e576210..3d358a3d7743 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