Too many return-statements = bad style?

Jeff Epler jepler at unpythonic.net
Fri Jul 9 14:22:51 CEST 2004


Some style guides discouraged multiple "return" statements out of
some theoretical superiority of the single-return form.  single-point-
of-return was supposed to lead to easier analysis.

Now, either this ease was for automatic analysis, in which case the
transformation from multiple return-sites to a single return site
might as well be done by the analysis software, rather than forcing a
human to do it.

... or it's for human analysis, in which case I'd say that my gut
reaction is the same as yours: having fewer indentation levels is
more important than having fewer return sites, within reason.

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20040709/152aa2d2/attachment.pgp>


More information about the Python-list mailing list