Exceptions as a Control Structure

Hamilcar Barca hamilcar at tld.always.invalid
Tue Aug 10 13:31:18 EDT 2004


In article <411775aa$0$17867$626a14ce at news.free.fr> (Mon, 09 Aug 2004
15:01:38 +0200), Olivier Parisy wrote:

> I come from C++, where the use of exceptions as control
> structures is frowned upon for efficiency reasons.

In Bertrand Meyer's Eiffel, this is prohibited by the language design. 
Exceptions wouldn't have been my choice for this kind of control, but Dr.
van Rossum is far more educated than I.

> What is the Python canon on this topic ? 

Exceptions are a primary control structure.

> Are exceptions considered as reasonable control structures, or is
> StopIteration alone of its kind ?

Yes.  No.

-- 
"It's not like IBM can support Linux the way they support the mainframe
 operating system. They don't write the code for it."
-- Steve Ballmer.  http://news.com.com/2008-1082-998297.html.  25 Apr 2003




More information about the Python-list mailing list