Pete Forman <[EMAIL PROTECTED]> writes:

> Ben Finney <[EMAIL PROTECTED]> writes:
>
> > Why not ensure that there is one return point from the function,
> > so the reader doesn't have to remind themselves to look for hidden
> > return points?
>
> There will always be more potential return points in languages that
> support exceptions.

I was specifically referring to 'return' points, i.e. points in the
function where a 'return' statement appears.

In the example to which I responded, the function had multiple
'return' statements, and an 'assert' to aid in finding out when none
of the return statements was hit. I'm making the point that if that
effort is being taken anyway, it's more readable to allow the reader
to see only *one* explicit return at the end, and not write any more
in the first place.

-- 
 \     "Ours is a world where people don't know what they want and are |
  `\    willing to go through hell to get it."  -- Donald Robert Perry |
_o__)                                                          Marquis |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to