[PyQt] How to avoid duplication in SIP?
Shaheed Haque
srhaque at theiet.org
Mon Apr 10 00:51:14 BST 2017
I believe that would need a sip parser to work that out, at least in the
case A was not created by me.
Mind you i guess the Feature guard idea would fail in the same case.
Is there perhaps a way to mark a mapped type as local to the defining
module?
On 9 Apr 2017 10:24 pm, "Phil Thompson" <phil at riverbankcomputing.com> wrote:
> On 9 Apr 2017, at 4:05 pm, Shaheed Haque <srhaque at theiet.org> wrote:
> >
> > A recurring problem with my SIP generator efforts is the need to deal
> > with duplicate SIP code. So far, I've been able to use the SIP concept
> > of a "feature" to deal with various manifestations of this, but I have
> > now hit one that has me stumped:
> >
> > - Module A has a mapped type MTA (e.g. QPair<init, int>)
> > - Module B imports A, but also needs a mapped type for QPair<int, int>.
> >
> > when the generator runs for module B, it is not aware of MTA, so it
> > ends up emitting MTB for its QPair<init, int>. Of course, when I run
> > SIP on B, MTA and MTB collide.
> >
> > Is there something already in SIP I could use to say "this duplicate
> > is fine"? If not, would it be possible to add support for the SIP
> > equivalent of a define guard, along the lines "#define
> > feature"/"#ifdef feature"?
> >
> > I realise that by generating the SIP code, I'm in a minority of SIP
> > users, but such a feature would also significantly simplify certain
> > other scenarios that affect me too.
>
> Why not fix your generator so that B knows the mapped type is defined
> elswhere?
>
> Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170410/7057b8de/attachment-0001.html>
More information about the PyQt
mailing list