Brandon Rhodes avatar Brandon Rhodes committed 7df45d4

Renamed "loops" to the more correct "cycles".

Comments (0)

Files changed (1)

         return ReprStr(format_object(self, verbose=True))
 
     @property
-    def loops(self, depth=4):
-        return ReprStr(format_loops(self._obj, depth=4))
+    def cycles(self, depth=4):
+        return ReprStr(format_cycles(self._obj, depth=4))
 
 
 def get_typename(obj):
     return ''.join('  {}*{}'.format(k.__name__, v) for k, v in citems if v)
 
 
-def format_loops(obj, depth=4):
-    """Describe the object loops found by deliving beneath `obj`."""
-    looplist = []
-    _loop_search(obj, (), ['$'], depth, looplist)
-    return '\n'.join('{} <- .{}'.format(*t) for t in looplist)
+def format_cycles(obj, depth=4):
+    """Describe the object cycles found by deliving beneath `obj`."""
+    cyclelist = []
+    _cycle_search(obj, (), ['$'], depth, cyclelist)
+    return '\n'.join('{} <- .{}'.format(*t) for t in cyclelist)
 
 
-def _loop_search(obj, parent_ids, names, depth, looplist):
+def _cycle_search(obj, parent_ids, names, depth, cyclelist):
     parent_ids += (id(obj),)
     go_deeper = depth > 1
     for name, value in iter_refs(obj):
         names.append(name)
         if id(value) in parent_ids:
             i = parent_ids.index(id(value)) + 1
-            looplist.append(('.'.join(names[:i]), '.'.join(names[i:])))
+            cyclelist.append(('.'.join(names[:i]), '.'.join(names[i:])))
         elif go_deeper:
-            _loop_search(value, parent_ids, names, depth - 1, looplist)
+            _cycle_search(value, parent_ids, names, depth - 1, cyclelist)
         names.pop()
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.