def test_func_defaults():
    def f(a, b): return (a, b)
    verify(f.func_defaults is None)
    f.func_defaults = (1, 2)
    verify(f.func_defaults == (1, 2))
    verify(f(10) == (10, 2))
    def g(a=1, b=2): return (a, b)
    verify(g.func_defaults == (1, 2))
    del g.func_defaults
    verify(g.func_defaults is None)
    try:
        g()
    except __HOLE__:
        pass
    else:
        raise TestFailed, "shouldn't be allowed to call g() w/o defaults"
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_funcattrs.py/test_func_defaults