[Python-ideas] breaking out of module execution

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 26 01:14:39 CEST 2012

Mark Shannon wrote:

> Also, I don't see the difference between a return in a module, and a 
> return in a function. Both terminate execution and return to the caller. 
> Why do these four points apply to module-level returns any more than 
> function-level returns?

I think the difference is that functions are usually small,
whereas modules can be very large. So there is much more scope
for surprises due to a return lurking in a module.


More information about the Python-ideas mailing list