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

Nicholas Devenish misnomer at gmail.com
Thu Oct 10 17:59:11 CEST 2013


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 "len() of unsized object" - And I can't work out what it is doing such that I can get this to work - I thought the TryUnaryOperation overload might be involved, but it doesn't seem to get called at all.

Is there a way to achieve this?

Thanks,

Nick


More information about the Ironpython-users mailing list