diff wsgraph/utils.py @ 8:f1f7a505e0d0

__contains__ method
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Dec 2012 17:08:02 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wsgraph/utils.py	Mon Dec 10 17:08:02 2012 -0800
@@ -0,0 +1,10 @@
+"""
+utility functions that should be in core python
+"""
+
+def isiterable(instance):
+    try:
+        iter(instance)
+        return True
+    except TypeError:
+        return False