Exception as the primary error handling mechanism?

Roy Smith roy at panix.com
Tue Jan 5 14:15:55 CET 2010

In article <hhv255$giu$1 at speranza.aioe.org>,
 r0g <aioe.org at technicalbloke.com> wrote:

> No, but that's why I try not to use languages where you can only return
> a single result, I always found that an arbitrary and annoying
> constraint to have. I leads to ugly practices like "magic" return values
>  in C or explicitly packing things into hashtables like PHP, yuk!

Python only lets you return a single result, just like C or C++.

The difference is that in Python it's trivial to build tuples on the fly 
and return them.  About the closest you get to that in C++ is std::pair, 
and that's about 5 bucks short and a week late.

More information about the Python-list mailing list