That'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> def getIndexedValue(obj,index):<br> return obj.Item[index]<br>else: #pywin32<br> def getIndexedValue(obj,index):<br> return obj(index) <br></div><br>
So I can (for example, reading the field definitions of an ADO recordset):<br><br> nOfFields=rs.Fields.Count<br> for i in range(nOfFields):<br> 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"><<a href="mailto:szport@gmail.com">szport@gmail.com</a>></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 <<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>>:<br>
<div><div></div><div class="Wj3C7c">> Oh, and I'm not sure if this is by design or not (I'll need to ping the DLR team), but it seems you can do:<br>
><br>
> wd.Variables.Item('foo')<br>
><br>
> instead.<br>
><br>
</div></div></blockquote></div><br>