Too many return-statements = bad style?
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list