mutable default parameter problem [Prothon]

Pierre-Frédéric Caillaud peufeu at free.fr
Fri Jun 18 04:52:04 EDT 2004




> I'm new to python. To my eyes this is a pretty poor attempt to
> have static variables. I've implemented in the past a few

	static variables in python

def accumulate( x ):
	accumulate.accumulator += x
	return accumulate.accumulator

accumulate.accumulator = 0
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/



More information about the Python-list mailing list