[PyQt] sip: translation error with operator *=

Phil Thompson phil at riverbankcomputing.com
Sun May 15 14:19:10 BST 2011


On Fri, 6 May 2011 10:44:54 -0700 (PDT), pymab <mabxsi at hotmail.com> wrote:
> Hi,
> 
> The following sip decl
> 
> CMatrix3 & operator*=(const CMatrix3& in_matrix3 );
> 
> gets translated to
> 
> static PyObject *slot_CMatrix3___imul__(PyObject *sipSelf,int a0)
> 
> which obviously doesn't compiled. I would have expected this translation
> instead:
> 
> static PyObject *slot_CMatrix3___imul__(PyObject *sipSelf,PyObject
*sipArg)

I can't reproduce this. What version of SIP?

> My other methods in the same class are properly translated though:
> 
> bool operator !=(const CMatrix3 & in_matrix3 ) const;
> static PyObject *slot_CMatrix3___ne__(PyObject *sipSelf,PyObject
*sipArg)
> 
> bool operator ==(const CMatrix3 & in_matrix3 ) const;
> static PyObject *slot_CMatrix3___eq__(PyObject *sipSelf,PyObject
*sipArg)
> 
> However , this one:
> CVector3 operator[](const short& in_sIndex);
> 
> is translated to: 
> static PyObject *slot_CMatrix3___getitem__(PyObject *sipSelf,PyObject
> *sipArg)

Which is correct.

> It looks like sip has inverted the args with
> static PyObject *slot_CMatrix3___imul__(PyObject *sipSelf,int a0)
> 
> Is there an issue with *= or [] methods ? 
> 
> thanks
> -mab

Phil



More information about the PyQt mailing list