Encapsulation, inheritance and polymorphism

Albert van der Horst albert at spenarnc.xs4all.nl
Mon Jul 23 12:18:18 EDT 2012


In article <5006b48a$0$29978$c3e8da3$5496439d at news.astraweb.com>,
Steven D'Aprano  <steve+comp.lang.python at pearwood.info> wrote:
<SNIP.
>Even with a break, why bother continuing through the body of the function
>when you already have the result? When your calculation is done, it's
>done, just return for goodness sake. You wouldn't write a search that
>keeps going after you've found the value that you want, out of some
>misplaced sense that you have to look at every value. Why write code with
>unnecessary guard values and temporary variables out of a misplaced sense
>that functions must only have one exit?

Example from recipee's:

Stirr until the egg white is stiff.

Alternative:
Stirr egg white for half an hour,
but if the egg white is stiff keep your spoon still.

(Cooking is not my field of expertise, so the wording may
not be quite appropriate. )

>--
>Steven

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst




More information about the Python-list mailing list