[PyQt] Type map for python to Qt?

Shaheed Haque srhaque at theiet.org
Sat Feb 4 21:35:11 GMT 2017


Hi Barry,

The tuple API does have a PyTuple_SetItem operation, but yes after I
thought about it more, I think I am going to go for lists because (a) it
looks nicer side-by-side, (b) offers less impedance mismatch with variable
sized arrays and multi-dimensional arrays and (c) is more consistent with
the use of PyBuffer for the array-of-bytes case.

I'm also toying with some ideas around mapping C++ unions into SIP by:

- expressing the C++ union as a SIP struct
- adding a GetCode/SetCode pair for the struct which does a memcpy on the
sizeof the union.

I know that sounds weird but I cannot immediately see why it would not
work. Thoughts?

Shaheed

On 4 February 2017 at 17:50, Barry <barry at barrys-emacs.org> wrote:

>
> > On 3 Feb 2017, at 22:19, Shaheed Haque <srhaque at theiet.org> wrote:
> >
> > fixed size arrays (1D for now, maybe more later). For the fixed size
> arrays, I'm looking for input on how to represent them in Python, i.e. as
> tuples or lists. My instinct is to go with tuples, but would be interested
> to hear other ideas.
>
> If the array has read only values the a tuple is ok. But if i can write
> values it must be a list API.
> You can implement a list whoes size cannot be changed with python C API.
>
> Barry
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170204/072f7fdf/attachment-0001.html>


More information about the PyQt mailing list