Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
 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
Exemple #4
0
 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