Re: [Ironpython-users] Calling len() on a DynamicObject instance?

2013-10-10 Thread Jeff Hardy
On Thu, Oct 10, 2013 at 8:59 AM, Nicholas Devenish wrote: > Hi All, > > I have a DynamicObject subclass that is being passed into IronPython. > Sometimes, this subclass represents a collection - at which point it is > currently either Enumerated through TryConvert or Indexed by TryGetIndex. > >

Re: [Ironpython-users] Calling len() on a DynamicObject instance?

2013-10-10 Thread Nicholas Devenish
On 10 Oct 2013, at 17:36, Jeff Hardy wrote: > I haven't looked at the implementation of len() yet, so I could be > wrong, but my guess is that if your object doesn't implement IList (or > something else with .Count) it will look for a __len__ method > (http://bit.ly/16TDkIJ) on the object. This

[Ironpython-users] Calling len() on a DynamicObject instance?

2013-10-10 Thread Nicholas Devenish
Hi All, I have a DynamicObject subclass that is being passed into IronPython. Sometimes, this subclass represents a collection - at which point it is currently either Enumerated through TryConvert or Indexed by TryGetIndex. However, when in python code calling len(myobject), I get the error "le