changeset 15:ee45f44394a0

i need a name, Bastian
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Dec 2012 17:33:44 -0800
parents 3d0430390e72
children 569a5d93b8e3
files wsgraph/model.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/wsgraph/model.py	Mon Dec 10 17:32:33 2012 -0800
+++ b/wsgraph/model.py	Mon Dec 10 17:33:44 2012 -0800
@@ -1,6 +1,6 @@
 from abc import abstractmethod
 from copy import deepcopy
-from utils import iterable
+from utils import isiterable
 
 class GraphModel(object):
 
@@ -36,7 +36,7 @@
         if key is a 2-tuple/list, return the edge of that name
         """
 
-        if isinstance(key, basestring) or (not iterable(key)):
+        if isinstance(key, basestring) or (not isiterable(key)):
             return self.node(key)
         else:
             return self.edge(*key)
@@ -47,12 +47,14 @@
         if key is a 2-tuple/list, returns if the edge is in the graph
         """
         # XXX not necessarily the best implementation!
-        if isinstance(key, basestring) or (not iterable(key)):
+        if isinstance(key, basestring) or (not isiterable(key)):
             return key in self.nodes()
         else:
             return tuple(key) in self.edges()
 
+
 class MemoryCache(GraphModel):
+    """volatile in-memory representation of a graph"""
 
     def __init__(self):
         self._edges = {}