From: Chris Emerson (chris_at_[hidden])
Date: 2001-07-13 07:41:43
Thanks for the quick reply!
On Fri, Jul 13, 2001 at 02:12:54PM +0200, Ullrich Koethe wrote:
> Chris Emerson wrote:
> > I've wrapped a C++ library which throws exceptions which I'd like to be
> > visible from Python more sensibly. The exceptions don't derive from
> > std::exception.
> Is there any good reason not to derive from std::exception? I don't see
I guess if it's an external library over which you can't/don't want to modify,
then yes. Fortunately that's not the case. I'll probably do that.
Can anyone point me to any discussion or advocacy on the subject, for my own
> > It looks like all exception handling is done in
> > boost::python::handle_exception(). Perhaps module_builder could have an
> > optional function pointer argument to add (or replace) handle_exception()?
> This could be done. However, to create corresponding Python exceptions,
> you must register new Python exception objects within the module. This
> is currently unsupported in Boost.Python.
I'm not averse to some dealing directly with Python to get some things done.
Probably because I'm used to SWIG, where it's necessary. Boost.Python is
fantastic in comparision (for C++ anyway), especially the built-in support
for strings, tuples, etc.!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk