[IronPython] C# 4.0 DynamicObject in IronPython

R. Bear Smith rbear at rbear.net
Thu May 28 04:58:32 CEST 2009


yea   works fine inside c#


From: Curt Hagenlocher 
Sent: Wednesday, May 27, 2009 10:57 PM
To: Discussion of IronPython 
Subject: Re: [IronPython] C# 4.0 DynamicObject in IronPython


Oops! Apparently I haven't quite read your message correctly. :(


On Wed, May 27, 2009 at 7:56 PM, Curt Hagenlocher <curt at hagenlocher.org> wrote:

  Have you cast the variable to type "dynamic"? that is,

  class MyDynamicObject : DynamicObject { ... }

  dynamic obj = new MyDynamicObject();
  dynamic memberval = obj.SomeMember;


  On Wed, May 27, 2009 at 7:54 PM, R. Bear Smith <rbear at rbear.net> wrote:

    Hi, I am trying to use a c# 4.0 class that derives from dynamicobject in the dlr for net 4.0 release with ironpython.  I am just basically trying to emulate the simple example from the pdc of using one of these classes from ironpython at this stage.  The problem is the class seems to be exposed as just a normal class with all its members like trygetmember,trysetmember exposed.  Any member access that should go to trygetmember and the other override methods returns with AttributeError - object has no attribute foo.  The class functions properly from within c#.  Just wondering if there is a known issue with this or if I am missing some extra step that has been introduced since earlier demos of this functionality.

    Thanks


    _______________________________________________
    Users mailing list
    Users at lists.ironpython.com
    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com








--------------------------------------------------------------------------------


_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090527/e9f4c406/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Emoticon1.gif
Type: image/gif
Size: 257 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090527/e9f4c406/attachment.gif>


More information about the Ironpython-users mailing list