On Nov 25, 2005, at 2:25 PM, Patrick Gerken wrote:

2005/11/24, Chris Withers <[EMAIL PROTECTED]>:
Interestingly, you can raise things that don't subclass Exception in
python. This was discussed before, and I firmly agree with, that zodb
conflicts should _not_ sublcass exception. That way, there's less chance of them being caught by inexperienced programmers putting in try: except
Exception: 's.

How would we go about making this change?

class my_own_exception:

  raise my_own_exception()
  print "Doesn't help against inexperienced programmers. sadly"

You can even raise a string, which is accidently done in zope2 and
where my with provided solution and unit test is pending.
It is better to beat people using except: without good reasons.

Yup. Lots of talk has been going on on python-dev about putting exceptions into multiple hierarchies lately, which would solve the problem at the right level.

- C

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to