def isstream(instance):
    """ check if a instance is a stream """
    try:
        import mmap
        i_am_not_mmap_obj = not isinstance(instance, mmap.mmap)
    except ImportError:
        i_am_not_mmap_obj = True
    return hasattr(instance, 'read') and i_am_not_mmap_obj
