Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
On Dec 24, 10:43 pm, "Gabriel Genellina" wrote: > En Wed, 24 Dec 2008 15:48:34 -0200, Gabriel Genellina   > escribió: > > > En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov   > > escribió: > > >> When you raise an exception in C++ you can set it to ANY Python object > >> via PyErr_SetObject a

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:48:34 -0200, Gabriel Genellina escribió: En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov escribió: When you raise an exception in C++ you can set it to ANY Python object via PyErr_SetObject and that object could store pointers to C++ classes. Remember that ex

Re: Custom C Exception Subclasses

2008-12-24 Thread Ross
On Dec 24, 9:24 am, "Gabriel Genellina" wrote: > In fact you can, you could store those pointers as attributes of the > exception object, using a PyCObject. Excellent. I was not aware of the PyCObject type. > Accessing those attributes isn't as easy as doing exc->field, but I think > it's easy

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov escribió: On Dec 24, 6:42 pm, Ross wrote: For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ cl

Re: Custom C Exception Subclasses

2008-12-24 Thread Gabriel Genellina
En Wed, 24 Dec 2008 13:42:38 -0200, Ross escribió: For a project that I am doing, it would be useful to have an exception class that stores some additional data along with the message. However, I want to be able to store a couple pointers to C++ classes, so I can't just use an exception created

Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
On Dec 24, 6:42 pm, Ross wrote: > For a project that I am doing, it would be useful to have an exception > class that stores some additional data along with the message. > However, I want to be able to store a couple pointers to C++ classes, > so I can't just use an exception created with PyExc_Ne