[EMAIL PROTECTED] wrote:
Emanuele D'Arrigo:
I can fragment the code of the original method into one public method and a few 
private support methods.<

Python also support nested functions, that you can put into your
method. The problem is that often unit test functions aren't able to
test nested functions.


A question for other people: Can Python change a little to allow
nested functions to be tested? I think this may solve some of my
problems.

The problem is that inner functions do not exist until the outer function is called and the inner def is executed. And they cease to exist when the outer function returns unless returned or associated with a global name or collection.

A 'function' only needs to be nested if it is intended to be different (different default or closure) for each execution of its def.

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

Reply via email to