[Python-Dev] GeneratorExit inheriting from Exception (original) (raw)

Barry Warsaw barry at python.org
Mon Mar 20 17:48:21 CET 2006


On Mon, 2006-03-20 at 08:18 -0800, Aahz wrote:

-1 -- I occasionally use exceptions as a multi-loop break. That's a perfectly valid Python practice, those exceptions should inherit from Exception, and there should not be any warnings raised.

Exactly! But they're not errors, so "except Exception" should catch them but "except Error" should not. This does speak to a generic ControlFlow (but not ControlFlowError) base class.

-Barry

-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 309 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-dev/attachments/20060320/3b4b02e4/attachment.pgp



More information about the Python-Dev mailing list