return command in a function.

Laura Creighton lac at strakt.com
Thu Sep 27 07:02:05 EDT 2001


Brian Lee:
> I think that commands are like ``goto'' It is very confused for me to 
> understand big code because such commands jump un-excepted line.

'un-excepted'?

1. Do you mean `The code jumps in ways I don't _expect_'?  
or
2. `The code should use the python Exception mechanism, but doesn't.'

If 1. you are probably confusing cause and effect.  The code is bad,
and _in addition_ it uses breaks and continues, and has a return 
statement in the middle of it.  Rewrite it.  Since it's 'big code'
try rewriting it _smaller_ in _more pieces_. Perhaps it could benefit
from being more Object-Oriented; without seeing it I can't tell, but
that is often the case with huge pieces of code that return in many 
different places.  

If 2. Very likely.

Laura Creighton




More information about the Python-list mailing list