def fact_err(n, acc=1): print 'fact(%s, %s)' % (n, acc) if n == 2: raise TypeError('fact') elif n > 1: raise Chain.call(fact_err.n(), n - 1, n * acc) else: return acc
def fact_err(n, acc=1): print "fact(%s, %s)" % (n, acc) if n == 2: raise TypeError("fact") elif n > 1: raise Chain.call(fact_err.n(), n - 1, n * acc) else: return acc
def fact(n, acc=1): print 'fact(%s, %s)' % (n, acc) if n > 1: raise Chain.call(fact.n(), n - 1, n * acc) return acc
def fact(n, acc=1): print "fact(%s, %s)" % (n, acc) if n > 1: raise Chain.call(fact.n(), n - 1, n * acc) return acc