[IronPython] Property information

Curt Hagenlocher curt at hagenlocher.org
Fri Jan 16 16:53:23 CET 2009


There is no one-to-one correspondence between Python types and CLR types.
 In fact, there really can't be (at least in the default case) because their
respective types work totally differently.
You'll need to use the ObjectOperations API to access your Python methods:
engine.Operations.GetMember(object, "methodname") will return a delegate to
the method.
engine.Operations.InvokeMember(object, "methodname", arg1, arg2, ...) will
execute a method.

On Fri, Jan 16, 2009 at 1:58 AM, Stefan Glimberg
<stefanglimberg at gmail.com>wrote:

> Hello,
>
> I am creating a Silverlight application using C# and underlying python
> classes. In the C# code, I would like to access information about any
> methods defined in the python code. The python classes inherit from my
> own C# classes, but the only type information availible is from the C#
> class, not the python class.
> I get a python class inheriting my own 'Component' and its type like this:
>
> Compoenent c = ScriptEngine.GetVariable<Component>(Scope, mInstanceName);
> Type t = c.GetType();
>
> Calling fx. t.GetMembers() only returns members from the C# Component
> calss, nothing from the python class.
> Is there any way to access the methods defined in the python class also?
>
> - Glimberg
> _______________________________________________
> 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/20090116/8eff2932/attachment.html>


More information about the Ironpython-users mailing list