Davy schrieb:
On Sep 3, 11:57 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
Assuming the function is tail-recursive or the "unchanging" arguments
are immutable, just use a closure:
[SNIP]
Hi Chris,

Thank you :)
Perhaps I should clarify the problem.
1. the function is NOT tail-recursive
2. Yes, the arguments are immutable after I call the function the
first time.

I think the best description of the problem may be:
How to keep some argument constant and accessable in one function
(especially, recursive function). We know that we can use something
like self.parameter to keep the parameter constant and accessable in
one class.


The same way chris showed you - using a closure, you can capture variables outside, and only pass the changing params.

The tail-recursion property isn't needed for that.

Diez
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to