def cantset(obj, name, value, exception=(AttributeError, TypeError)):
    verify(hasattr(obj, name)) # Otherwise it's probably a typo
    try:
        setattr(obj, name, value)
    except exception:
        pass
    else:
        raise TestFailed, "shouldn't be able to set %s to %r" % (name, value)
    try:
        delattr(obj, name)
    except (AttributeError, TypeError):
        pass
    else:
        raise TestFailed, name % "shouldn't be able to del %s"
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_funcattrs.py/cantset/swapped operands of `%`