Beispiel #1
0
def dumpable(obj):
    """indicates whether the object is dumpable by brine"""
    if type(obj) in simple_types:
        return True
    if type(obj) in (tuple, frozenset):
        return all(dumpable(item) for item in obj)
    return False
Beispiel #2
0
def dumpable(obj):
    """indicates whether the object is dumpable by brine"""
    if type(obj) in simple_types:
        return True
    if type(obj) in (tuple, frozenset):
        return all(dumpable(item) for item in obj)
    return False
Beispiel #3
0
def dumpable(obj):
    """Indicates whether the given object is *dumpable* by brine
    
    :returns: ``True`` if the object is dumpable (e.g., dumps would succeed),
              ``False`` otherwise
    """
    if type(obj) in simple_types:
        return True
    if type(obj) in (tuple, frozenset):
        return all(dumpable(item) for item in obj)
    return False
Beispiel #4
0
def dumpable(obj):
    """Indicates whether the given object is *dumpable* by brine
    
    :returns: ``True`` if the object is dumpable (e.g., :func:`dump` would succeed),
              ``False`` otherwise
    """
    if type(obj) in simple_types:
        return True
    if type(obj) in (tuple, frozenset):
        return all(dumpable(item) for item in obj)
    if type(obj) is slice:
        return dumpable(obj.start) and dumpable(obj.stop) and dumpable(obj.step)
    return False
Beispiel #5
0
def dumpable(obj):
    """Indicates whether the given object is *dumpable* by brine
    
    :returns: ``True`` if the object is dumpable (e.g., dumps would succeed),
              ``False`` otherwise
    """
    if type(obj) in simple_types:
        return True
    if type(obj) in (tuple, frozenset):
        return all(dumpable(item) for item in obj)
    if type(obj) is slice:
        return dumpable(obj.start) and dumpable(obj.stop) and dumpable(
            obj.step)
    return False