On 14 Jun 2012 at 15:01, Wichert Akkerman wrote:

> On 06/14/2012 02:33 PM, Niall Douglas wrote:
> > Do you think that this answer is worth adding to the BPL FAQ?
> > Normally you don't need to derive from Python's Exception object, and
> > indeed in my own custom exception implementations I never did so.
> > However, if this has changed, an FAQ entry is appropriate.
> 
> Python is certainly going in that direction. You used to be able to do 
> all kinds of crazy things such as using strings as exceptions but 
> current versions are much stricter about what you can raise. This is 
> what Python 2 says:

C++ is going in that direction too :)

>From my own perspective, inheriting std::exception says that you 
comply with std::exception and you want your exceptions to be 
categorised as a std::exception. In my custom exception handling, I 
definitely did not want that as my exceptions could do fun stuff like 
aggregrate themselves when being multiply rethrown during destructor 
unwinds, something I still think C++11 gives up too easily upon. 
Maybe if I get my exception handling support into ISO C I might 
finally win that argument :)

Now I vaguely remember something on this list about 3k needing to 
inherit from BaseException, and that broke BPL. I vaguely remember 
the solution Dave or somebody suggested was to wire in a 
BaseException inheritance on 3k only and not on 2k for backwards 
compatibility.

I absolutely agree we need a policy in BPL which fixes this properly.

Niall

-- 
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to