Commits

Anonymous committed f219373

documenting astutils.get_name_levels

Comments (0)

Files changed (4)

rope/base/astutils.py

 
 
 def get_name_levels(node):
+    """Return a list of ``(name, level)`` tuples for assigned names
+
+    The `level` is `None` for simple assignments and is a list of
+    numbers for tuple assignments for example in::
+
+      a, (b, c) = x
+
+    The levels for for `a` is ``[0]``, for `b` is ``[1, 0]`` and for
+    `c` is ``[1, 1]``.
+
+    """
     visitor = _NodeNameCollector()
     ast.walk(node, visitor)
     return visitor.names

rope/base/codeanalyze.py

 
 import rope.base.exceptions
 import rope.base.pynames
-import rope.base.pyobjects
 from rope.base import pyobjects, evaluate
 
 

rope/base/pynames.py

 
 
 class UnboundName(PyName):
-    
+
     def __init__(self, pyobject=None):
         self.pyobject = pyobject
         if self.pyobject is None:

rope/base/pyscopes.py

+import rope.base.builtins
+import rope.base.codeanalyze
 import rope.base.pynames
 from rope.base import ast, exceptions