[Python.NET] subclassing managed types in python

Kyle Rocha kyle.rocha at gmail.com
Thu Oct 17 19:15:11 CEST 2013


I was also looking into implementing the  monodevelop document and project
interfaces in python in order to provide better .Net project development in
sublime.

Didn't get too far unfortunately.
On Oct 9, 2013 2:52 AM, "Tony Roberts" <tony at pyxll.com> wrote:

> Hi,
>
> am I right in thinking that currently when managed types are subclassed in
> python the python methods can't override the base class methods when called
> from .net?
>
> It would be useful to be able to do this for something I'm working on at
> the moment, and before I started looking at it I wondered if anyone has
> done any work on this before?
>
> I think it should be possible to achieve by creating new managed types
> using System.Reflection.Emit.TypeBuilder and replace any virtual methods
> with ones that first look for a method on the python object with the same
> name before falling back to the base class method - the same way SWIG
> wrappers work for C++ classes basically but done dynamically. In the case
> where there are multiple methods with the same name but different
> signatures the python method would override them all and have to check what
> it had been passed to do the right thing.
>
> Any thoughts?
>
> thanks,
> Tony
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> https://mail.python.org/mailman/listinfo/pythondotnet
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20131017/f7a7425f/attachment.html>


More information about the PythonDotNet mailing list