<div dir="ltr"><div><div><div><div><div>Hi Barry,<br><br></div>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.<br><br></div>I'm also toying with some ideas around mapping C++ unions into SIP by:<br><br></div>- expressing the C++ union as a SIP struct<br></div>- adding a GetCode/SetCode pair for the struct which does a memcpy on the sizeof the union.<br><br></div>I know that sounds weird but I cannot immediately see why it would not work. Thoughts?<br><div><div><div><div><br></div><div>Shaheed<br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 February 2017 at 17:50, Barry <span dir="ltr"><<a href="mailto:barry@barrys-emacs.org" target="_blank">barry@barrys-emacs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 3 Feb 2017, at 22:19, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> wrote:<br>
><br>
> 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.<br>
<br>
</span>If the array has read only values the a tuple is ok. But if i can write values it must be a list API.<br>
You can implement a list whoes size cannot be changed with python C API.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
<br>
<br>
</font></span></blockquote></div><br></div>