<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On 4 Feb 2017, at 21:59, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 4 February 2017 at 21:56, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
<br>
> On 4 Feb 2017, at 21:35, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> wrote:<br>
><br>
> Hi Barry,<br>
><br>
> The tuple API does have a PyTuple_SetItem operation,<br>
<br>
</span>But that can only be used once to init the tuple. You cannot come back and replace a value.<br>
List is the only option if the array can be updated.<br></blockquote><div><br>I suspect you may well be right.<br></div></div></div></div></blockquote><div><br></div><div>Tuples are immutable even in C code.</div><div><br></div><div>The setitem function can only be used after you creat the tuple with PyTuple_New.</div><div>Once you give a ref to a tuple away you must not attempt to modify by any means as that breaks python assumptions. I do not recall if python with assert on you if you break the rules.</div><div><br></div><div>Barry</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class="gmail-HOEnZb"></span></div></div></div></div>
</blockquote></body></html>