Iteration for Factorials

Marco Mariani marco at sferacarta.com
Fri Oct 26 06:30:13 EDT 2007


marek.rocki at wp.pl 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




More information about the Python-list mailing list