control structures (was "Re: Sins")

Magnus L. Hetland mlh at vier.idi.ntnu.no
Sun Dec 26 18:23:02 EST 1999


Phil Jensen <pjensen at columbus.rr.com> writes:

> I forget if I posted this before, but what I'd like to
> see is the Zahn construct discussed in Knuth's article -
> Pythonically:
> 
>     loop until "element found" or "search failed":
>         ...
>         if blah1 == blah2:
>             "element found"
>         ...
>     when "element found":
>         ...
>     when "search failed":
>         ...
>   Phil Jensen
> 

See also http://magnus.n3.net/python/detect.html for another similar
construct, suggested at about the same time as Zahn's (supposedly as
an improvement. I am working on putting the original article online,
but - it's not there yet ;)

--

  Magnus
  Lie
  Hetland



More information about the Python-list mailing list