Russ <[EMAIL PROTECTED]> wrote:
   ...
> > > the inputs. To test the
> > > post-conditions, you just need a call at the bottom of the function,
> > > just before the return,
   ...
> > there's nothing to stop you putting the calls before every return.
> 
> Oops! I didn't think of that. The idea of putting one before every
> return certainly doesn't appeal to me. So much for that idea.

try:
  blah blah with as many return statements as you want
finally:
  something that gets executed unconditionally at the end

You'll need some convention such as "all the return statements are of
the same form ``return result''" (where the result may be computed
differently each time), but that's no different from the conventions you
need anyway to express such things as ``the value that foobar had at the
time the function was called''.


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

Reply via email to