def _split ( value ) : if isinstance ( value , str ) : # iterable, but not meant for splitting return value , value try : invalue , outvalue = value except TypeError : invalue = outvalue = value except ValueError : raise ValueError ( "Only single values and pairs are allowed" ) return invalue , outvalue
python split not enough values to unpack (expected 2, got 1)
Split input / output value into two values .
def _split(value):
    """Split input/output value into two values."""
    if isinstance(value, str):
        # iterable, but not meant for splitting
        return value, value
    try:
        invalue, outvalue = value
    except TypeError:
        invalue = outvalue = value
    except ValueError:
        raise ValueError("Only single values and pairs are allowed")
    return invalue, outvalue