[Python-ideas] breaking out of module execution

Arnaud Delobelle arnodel at gmail.com
Wed Apr 25 16:44:11 CEST 2012


(sent from my phone)
On Apr 25, 2012 3:01 PM, "M.-A. Lemburg" <mal at egenix.com> wrote:
>
> Ronald Oussoren wrote:
> >
> > Also, why use the proposed module-scope return instead of an
if-statement with nested definitions, this works just fine:
> >
> > : def foo(): pass
> > :
> > : if sys.platform == 'linux':
> > :
> > :    def linux_bar(): pass
>
> Because this only works reasonably if you have a few lines of code
> to indent. As soon as you have hundreds of lines, this becomes
> both unreadable and difficult to edit.

OTOH the return statement becomes really hard to spot...

Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120425/3f2b6601/attachment.html>


More information about the Python-ideas mailing list