RE: Wrapper for exception translation
-----Original Message----- From: David Abrahams [mailto:dave@boost-consulting.com] Sent: Monday, December 13, 2004 1:04 PM To: c++-sig@python.org; Gottfried Ganßauge Subject: Re: Wrapper for exception translation
Gottfried Ganßauge wrote:
Hi Dave,
I digged through the class_<> implementation and I think I know what I must do to implement it. Like you suggested I would add another argument to the class_base constructor which is used as another base class for the newly created class.
Hi Gottfried, Hi Dave,
I don't know if you're still listening, but today I offered to implement this patch on the C++-sig (see my other post). Are you still interested?
I am still listening but was buried deeply with work so I even had to abandon the work already invested into this. Nonetheless: Yes - I'm still interested. Cheers, Gottfried P.S.: What second Post? I got 2 Copies of this one.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
I need to be able to translate custom C++ exceptions into similar Python entities, so was looking through the newsgroup for tips. In particular, I would like the translated exceptions to be derived off Exception and not be limited to one of the already provided exceptions types. I found this thread and am interested, as it seems to offer exactly the functionality required. What is the status of this functionality? If some finishing of the implementation is required, then I'm prepared to have a look. Can't say for 100% that I'll be able to do it - but I'll have a look. 8^) Colin
Hi, Colin Irwin wrote:
I need to be able to translate custom C++ exceptions into similar Python entities, so was looking through the newsgroup for tips. In particular, I would like the translated exceptions to be derived off Exception and not be limited to one of the already provided exceptions types. I found this thread and am interested, as it seems to offer exactly the functionality required. What is the status of this functionality? If some finishing of the implementation is required, then I'm prepared to have a look. Can't say for 100% that I'll be able to do it - but I'll have a look. 8^)
I guess you could use *PyErr_NewException with the standard boost::python way of translating exceptions. Take a look at the tutorial and the Python C API section of the python documentation. Regards, Nicodemus. *
Colin Irwin <colin_irwin@hotmail.com> writes:
I need to be able to translate custom C++ exceptions into similar Python entities, so was looking through the newsgroup for tips. In particular, I would like the translated exceptions to be derived off Exception and not be limited to one of the already provided exceptions types. I found this thread and am interested, as it seems to offer exactly the functionality required. What is the status of this functionality? If some finishing of the implementation is required, then I'm prepared to have a look. Can't say for 100% that I'll be able to do it - but I'll have a look. 8^)
It's easy enough to implement the guts. What happened is that it became clear I needed unnamed parameter support (like .def, where parameters can come in any order) in order to implement a good interface. I started to look into extending the named parameters library (http://article.gmane.org/gmane.comp.lib.boost.announce/54, http://article.gmane.org/gmane.comp.lib.boost.announce/55) to support unnamed parameters, and got stuck because I didn't understand the code anymore (partly my own forgetfulness, partly the code itself). Daniel Wallin, the library's co-author was going to try to clear things up. Since then, I'm not sure what's happened. -- Dave Abrahams Boost Consulting www.boost-consulting.com
Dave - where do you recommend that I start looking at this one? I understand what has been discussed as part of this thread and I'll have a look at the named parameters library as you suggest. I just don't want to have to start from the beginning, if a fine start has already been done / exists somewhere.
Colin Irwin <colin_irwin@hotmail.com> writes:
Dave - where do you recommend that I start looking at this one?
I understand what has been discussed as part of this thread and I'll have a look at the named parameters library as you suggest.
I wasn't suggesting that.
I just don't want to have to start from the beginning, if a fine start has already been done / exists somewhere.
I suggest you wait a week or so. Daniel has promised to finish cleaning up and commenting that library in the next few days. After that we'll discuss how to add unnamed parameter support, and if we can do that quickly, within a few more days I can provide the ability to specify a Python base class. -- Dave Abrahams Boost Consulting www.boost-consulting.com
Dave - In the previous post you stated that Daniel Wallin was doing a bit of cleaning in the code base for the named parameter library. Did this happen? Is it now possible to add unnamed parameter support? Anyway, I think I'm still keen to do whatever on this front to help with a wrapper to translate exceptions through into Python. Colin
Colin Irwin <colin_irwin@hotmail.com> writes:
Dave - In the previous post you stated that Daniel Wallin was doing a bit of cleaning in the code base for the named parameter library. Did this happen?
Yes, Daniel and I have done that cleanup.
Is it now possible to add unnamed parameter support?
Yep, we're starting on it now.
Anyway, I think I'm still keen to do whatever on this front to help with a wrapper to translate exceptions through into Python.
Thanks; I'll keep it in mind. -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams <dave <at> boost-consulting.com> writes:
Colin Irwin <colin_irwin <at> hotmail.com> writes:
Anyway, I think I'm still keen to do whatever on this front to help with a wrapper to translate exceptions through into Python.
Thanks; I'll keep it in mind.
Hello, just wanted to ask whether anyone found time yet to implement the exception wrapping template? Best regards, Peter Dinges
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, just wanted to ask whether anyone has already found the time to implement the exception wrapping stuff? Best regards, Peter Dinges -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFELXdj3a2HTCygF3QRArhyAJ0UJHyOvqcUgl3RjARs0S10F7TR4QCfS2AB 5o5iXnhD/ng/ejHy6yNwiDk= =Axef -----END PGP SIGNATURE-----
participants (5)
-
Colin Irwin -
David Abrahams -
Gottfried.Ganssauge@HAUFE.DE -
Nicodemus -
Peter Dinges