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:
if onIronPython:
    def getIndexedValue(obj,index):
        return obj.Item[index]
else: #pywin32
   def getIndexedValue(obj,index):
        return obj(index)

So I can (for example, reading the field definitions of an ADO recordset):

            nOfFields=rs.Fields.Count
            for i in range(nOfFields):
                f=getIndexedValue(rs.Fields,i)

Question: Will this continue to work in future versions of IronPython?
--
Vernon Cole

On Wed, Nov 26, 2008 at 2:50 AM, Zaur Shibzoukhov <[EMAIL PROTECTED]> wrote:

> What will happen with the item-like access to COM objects in IP 2.0?
>
> Whether it will return to []-like access (as in RC 1) or it will
> remain .Item(...)?
> IMHO RC 1 way is more preferred.
>
> Best regards,
> Zaur
>
> 2008/10/27 Dino Viehland <[EMAIL PROTECTED]>:
> > 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:
> >
> > wd.Variables.Item('foo')
> >
> > instead.
> >
>
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to