summaryrefslogtreecommitdiffstats
path: root/keyedcache/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'keyedcache/utils.py')
-rw-r--r--keyedcache/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/keyedcache/utils.py b/keyedcache/utils.py
new file mode 100644
index 00000000..29b8fd71
--- /dev/null
+++ b/keyedcache/utils.py
@@ -0,0 +1,14 @@
+import types
+
+def is_string_like(maybe):
+ """Test value to see if it acts like a string"""
+ try:
+ maybe+""
+ except TypeError:
+ return 0
+ else:
+ return 1
+
+
+def is_list_or_tuple(maybe):
+ return isinstance(maybe, (types.TupleType, types.ListType))