That&#39;s a really fine question. I had to change all of my COM item access twice now in adodbapi. I finally ended up using a function, because iron python and c python are so different in this area. My current code is:<br>
<div style="margin-left: 40px;">if onIronPython: <br>&nbsp;&nbsp;&nbsp; def getIndexedValue(obj,index):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return obj.Item[index]<br>else: #pywin32<br>&nbsp;&nbsp; def getIndexedValue(obj,index):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return obj(index) <br></div><br>
So I can (for example, reading the field definitions of an ADO recordset):<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nOfFields=rs.Fields.Count<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i in range(nOfFields):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f=getIndexedValue(rs.Fields,i)<br><br>Question: Will this continue to work in future versions of IronPython?<br>
--<br>Vernon Cole<br><br><div class="gmail_quote">On Wed, Nov 26, 2008 at 2:50 AM, Zaur Shibzoukhov <span dir="ltr">&lt;<a href="mailto:szport@gmail.com">szport@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What will happen with the item-like access to COM objects in IP 2.0?<br>
<br>
Whether it will return to []-like access (as in RC 1) or it will<br>
remain .Item(...)?<br>
IMHO RC 1 way is more preferred.<br>
<br>
Best regards,<br>
Zaur<br>
<br>
2008/10/27 Dino Viehland &lt;<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt; Oh, and I&#39;m not sure if this is by design or not (I&#39;ll need to ping the DLR team), but it seems you can do:<br>
&gt;<br>
&gt; wd.Variables.Item(&#39;foo&#39;)<br>
&gt;<br>
&gt; instead.<br>
&gt;<br>
</div></div></blockquote></div><br>