Too many return-statements = bad style?

Peter Hansen peter at engcorp.com
Fri Jul 9 08:50:01 EDT 2004


Rgemini wrote:

> I do it that way too. But I put exit comments next to the returns so they
> stand out more. Something like
> 
>     return foo    ##### exit because foo = bar #####

Wouldn't that be redundant if the code read this way?

     if foo == bar:
         return foo

-Peter



More information about the Python-list mailing list