summaryrefslogtreecommitdiffstats
path: root/keyedcache/utils.py
blob: 29b8fd717bf8d54ca0ab6d4663858b16f56f33eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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))