Re: Iteration for Factorials
- From: Marco Mariani <marco@xxxxxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 12:30:13 +0200
marek.rocki@xxxxx wrote:
class fact_0(object):[...
value = 1
def __new__(self, n_):
class spanish_inquisition(object):
__metaclass__ = fact_meta
n = n_
return spanish_inquisition()
You wrote lots of boilerplate to hide the fact you're cheating, didn't you?
The OP explicitly asked for an iterative procedure.
btw... writing a test unit to check the tested code is not calling itself.. could be interesting
.
- References:
- Iteration for Factorials
- From: Py-Fun
- Re: Iteration for Factorials
- From: Diez B. Roggisch
- Re: Iteration for Factorials
- From: Py-Fun
- Re: Iteration for Factorials
- From: Marco Mariani
- Re: Iteration for Factorials
- From: Py-Fun
- Re: Iteration for Factorials
- From: Ant
- Re: Iteration for Factorials
- From: Marco Mariani
- Re: Iteration for Factorials
- From: Tim Golden
- Re: Iteration for Factorials
- From: Marco Mariani
- Re: Iteration for Factorials
- From: Tim Golden
- Re: Iteration for Factorials
- From: marek . rocki
- Iteration for Factorials
- Prev by Date: tuples within tuples
- Next by Date: object inheritance
- Previous by thread: Re: Iteration for Factorials
- Next by thread: Re: Iteration for Factorials
- Index(es):
Relevant Pages
|