4 ms·
I second the answer about having them before var-block: In python I always follow the style of having nested functions directly after the outer function header,
by m_mueller 8y ago
I second the answer about having them before var-block: In python I always follow the style of having nested functions directly after the outer function header, and only going one layer deep. This way the only thing in their scope is their parameters as well as the parameters of the outer function. Using this restriction I find them very useful and concise - much better than having one-off helper functions in the outer module scope.