[PyQt] SIP, multiple constructors and exceptions
Andrew Perella
ajp at eutechnyx.com
Wed May 14 14:44:19 BST 2008
When a class is wrapped with multiple constructors, the generated sip
binding code does not raise an exception if the python calling code does not
provide matching arguments.
Is this by design?
Eg:
extern "C" {static void *init_CutScenePythonState(sipWrapper *, PyObject *,
sipWrapper **, int *);}
static void *init_CutScenePythonState(sipWrapper *sipSelf,PyObject
*sipArgs,sipWrapper **,int *sipArgsParsed)
{
sipCutScenePythonState *sipCpp = 0;
if (!sipCpp)
{
if (sipParseArgs(sipArgsParsed,sipArgs,""))
{
sipCpp = new sipCutScenePythonState();
}
}
if (!sipCpp)
{
const CutScenePythonState * a0;
if
(sipParseArgs(sipArgsParsed,sipArgs,"JA",sipClass_CutScenePythonState,&a0))
{
sipCpp = new sipCutScenePythonState(*a0);
}
}
if (sipCpp)
sipCpp->sipPySelf = sipSelf;
// NO EXCEPTION RAISED HERE IF sipCPP is NULL!
return sipCpp;
}
Cheers,
Andrew
Dr A J Perella
Chief Software Architect
Eutechnyx Ltd.
http://www.eutechnyx.com
This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law.
This email has been scanned for all known viruses by the Email Protection Agency.
www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080514/0301f9d5/attachment.html
More information about the PyQt
mailing list