[IronPython] Issue reading an InternalDictionary, Overloads fails with 2147483647 arguments bug.

Dino Viehland dinov at microsoft.com
Tue May 24 03:50:33 CEST 2011


Sounds like Action[Avatar] is working then - it's just that the lambda isn't doing
anything that you can see.  If you change it to:

l = []
temp.ForEach.Overloads[Action[Avatar]](lambda x: l.append(x.FirstName))

Then l should be populated with all the first names you're called with.  

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Intertricity
> Sent: Monday, May 23, 2011 5:55 PM
> To: users at lists.ironpython.com
> Subject: Re: [IronPython] Issue reading an InternalDictionary, Overloads fails
> with 2147483647 arguments bug.
> 
> Still get the same problem :\ although the Action[Avatar] one returns a
> NoneType instead of complaining about an insane number of arguments.
> 
> #############
> >>> temp.ForEach.Overloads[InternalDictionary[UInt32,Avatar],Avatar](lam
> >>> bda x: x
> .FirstName)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: ForEach() takes at least 2147483647 arguments (1 given)
> >>>
> 
> #############
> #############
> >>> temp.ForEach.Overloads[Action[Avatar]](lambda x: x.FirstName)
> >>> dir(temp.ForEach.Overloads[Action[Avatar]](lambda x: x.FirstName))
> ['Equals', 'GetHashCode', 'GetType', 'MemberwiseClone', 'ReferenceEquals',
> 'ToSt ring', '__class__', '__delattr__', '__doc__', '__format__',
> '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__',
> '__reduce_ex__', '__repr__', '_ _setattr__', '__sizeof__', '__str__',
> '__subclasshook__']
> >>> type(temp.ForEach.Overloads[Action[Avatar]](lambda x: x.FirstName))
> <type 'NoneType'>
> >>>
> #############
> 
> 
> On May 23, 12:56 pm, Dino Viehland <di... at microsoft.com> wrote:
> > I think your .Overloads needs to be:
> >
> > .Overloads[Action[Avatar]]
> >
> > Or maybe:
> >
> > .Overloads[InternalDictionary[UInt32, Avatar], Avatar]
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: users-boun... at lists.ironpython.com [mailto:users-
> > > boun... at lists.ironpython.com] On Behalf Of Intertricity
> > > Sent: Monday, May 23, 2011 12:53 AM
> > > To: us... at lists.ironpython.com
> > > Subject: [IronPython] Issue reading an InternalDictionary, Overloads
> > > fails with 2147483647 arguments bug.
> >
> > > I'm trying to read the keys of an InternalDictionary of a .Net dll
> > > I'm loading into IronPython. The library is libomv.
> >
> > > I've googled for several hours now, and I can't seem to find a clear
> > > way to get around this.
> > > Here's the doc string on the ForEach I'm trying to use, I've
> > > referenced temp to the object in question to keep things short while I'm
> at the interpreter.
> >
> > > >>> print temp.ForEach.__doc__
> > > ForEach(self: InternalDictionary[UInt32, Avatar], action:
> > > Action[KeyValuePair[UI
> > > nt32, Avatar]])
> > >     Perform an  on each key of an
> >
> > >     action: to perform
> > > ForEach(self: InternalDictionary[UInt32, Avatar], action:
> > > Action[UInt32])
> > >     Perform an  on each key of an
> >
> > >     action: to perform
> > > ForEach(self: InternalDictionary[UInt32, Avatar], action:
> > > Action[Avatar])
> > >     Perform an  on each key of an
> >
> > >     action: to perform
> >
> > > And here's what happens when I try to use the Overloads method to
> > > solve
> > > overloading:
> >
> > > >>> temp.ForEach.Overloads[Avatar](lambda x: x.FirstName)
> > > Traceback (most recent call last):
> > >   File "<stdin>", line 1, in <module>
> > > TypeError: ForEach() takes at least 2147483647 arguments (1 given)
> >
> > > Anyone have a clue how to get this to work? I'm not too familiar
> > >with .Net,  and got into it through IronPython, so I'm not sure what
> > >I could be doing  wrong.
> > > _______________________________________________
> > > Users mailing list
> > > Us... at lists.ironpython.com
> > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> > _______________________________________________
> > Users mailing list
> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/use
> > rs-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list