[Python-checkins] commit of r41540 - python/trunk/Lib/compiler

neal.norwitz@python.org neal.norwitz at python.org
Fri Nov 25 04:19:34 CET 2005


Author: neal.norwitz
Date: Fri Nov 25 04:19:29 2005
New Revision: 41540

Modified:
   python/trunk/Lib/compiler/transformer.py
Log:
Remove unused _callers member. No need for types, use isinstance

Modified: python/trunk/Lib/compiler/transformer.py
==============================================================================
--- python/trunk/Lib/compiler/transformer.py	(original)
+++ python/trunk/Lib/compiler/transformer.py	Fri Nov 25 04:19:29 2005
@@ -762,8 +762,6 @@
     def lookup_node(self, node):
         return self._dispatch[node[0]]
 
-    _callers = {}
-
     def com_node(self, node):
         # Note: compile.c has handling in com_node for del_stmt, pass_stmt,
         #       break_stmt, stmt, small_stmt, flow_stmt, simple_stmt,
@@ -1427,7 +1425,6 @@
     symbol.factor,
     ]
 
-import types
 _names = {}
 for k, v in symbol.sym_name.items():
     _names[k] = v
@@ -1437,9 +1434,9 @@
 def debug_tree(tree):
     l = []
     for elt in tree:
-        if type(elt) == types.IntType:
+        if isinstance(elt, int):
             l.append(_names.get(elt, elt))
-        elif type(elt) == types.StringType:
+        elif isinstance(elt, str):
             l.append(elt)
         else:
             l.append(debug_tree(elt))


More information about the Python-checkins mailing list