I wouldn't expect any breaking changes in COM until IronPython 3.0 at the 
earliest.  That being said our COM binding logic is actually owned by the DLR 
team.  They have been and will continue working on fixing bugs in the COM 
binding logic.  Therefore you might see us integrate in small bug fixes but 
nothing that would break your code.

I think ideally we'd all love to see us match pywin32 as closely as possible so 
we might at some point revisit the way we currently are doing the binding (and 
recent changes in the DLR should make this much easier than it was before).  I 
think we'd approach this by enabling both behaviors so .Item works as well as 
calling, eventually start issuing warnings on .Item, and then finally remove 
.Item in Ipy 3k or later.
________________________________
From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Vernon Cole [EMAIL 
PROTECTED]
Sent: Wednesday, November 26, 2008 7:51 AM
To: Discussion of IronPython
Subject: Re: [IronPython] COM Object Issue

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]<mailto:[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]<mailto:[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