[Python-Dev] Python in Unicode context

Greg Ewing greg at cosc.canterbury.ac.nz
Fri Aug 6 02:32:32 CEST 2004


> Then i guess that searching down into a recursive structure and just 
> raising an "i found it" result object up doesn't count as a use case in
> your book, right?

You can always wrap the object you want to return in a suitable
subclass of Exception. I would prefer to write it that way anyway,
otherwise I'd need some sort of "catch anything which *isn't* a
subclass of Exception" statement, which is rather awkward to spell.

If this is considered a common enough requirement, a special built-in
Exception subclass could even be provided for it, to save people the
bother of defining their own...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list