This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
bistro/keyedcache/utils.py

15 lines
281 B
Python

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))