From J.vanDam at bronkhorst.com Tue Apr 14 13:59:43 2015 From: J.vanDam at bronkhorst.com (Jesse van Dam) Date: Tue, 14 Apr 2015 13:59:43 +0200 Subject: [Python.NET] Python for .Net Message-ID: Hello, I'm trying to use the clr module but it doesn't work for an Action object. To find a solution for my problem if posted this stackoverflow question: http://stackoverflow.com/questions/29538031/call-dll-function-works-in-ironpython-doesnt-work-in-cpython3-4-gives-no-meth Do you have any clue why this doesn't work? Best regards J van Dam -------------- next part -------------- An HTML attachment was scrubbed... URL: From Oscar.Le at software.dell.com Tue Apr 21 16:47:31 2015 From: Oscar.Le at software.dell.com (Oscar Le) Date: Tue, 21 Apr 2015 14:47:31 +0000 Subject: [Python.NET] Does python .net support creating a class inherited from an interface class declared by c#? Message-ID: <08BEF311A0DA2640820417971234FF37223BACC6@ALVMBXW01.prod.quest.corp> Hi There, I want to create a class which can be inherited from an interface class declared by c#. But it throws TypeError when I instance it: "object does not implement IServiceCallbackContract". class ServiceCallbackContract(IServiceCallbackContract): def __init__(self, c): pass object = ServiceCallbackContract(AClass) Then I added some debug messages in the Python.Net source code. [cid:image001.png at 01D07C84.4EA703C0] I mean I want to create a class as the implementation of the interface class which is declared by C# in a DLL file, I'm unable to change the code in that DLL file. So is there any way to make it works for my purpose by python.net? Thanks, Best regards, Oscar Le -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 42660 bytes Desc: image001.png URL: From denis.akhiyarov at gmail.com Tue Apr 21 17:56:25 2015 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Tue, 21 Apr 2015 15:56:25 +0000 Subject: [Python.NET] Does python .net support creating a class inherited from an interface class declared by c#? In-Reply-To: <08BEF311A0DA2640820417971234FF37223BACC6@ALVMBXW01.prod.quest.corp> References: <08BEF311A0DA2640820417971234FF37223BACC6@ALVMBXW01.prod.quest.corp> Message-ID: Does this work in Ironpython? On Tue, Apr 21, 2015, 10:33 AM Oscar Le wrote: > Hi There, > > > > I want to create a class which can be inherited from an interface class > declared by c#. But it throws TypeError when I instance it: ?object does > not implement IServiceCallbackContract?. > > > > *class ServiceCallbackContract(IServiceCallbackContract):* > > * def __init__(self, c):* > > * pass* > > > > *object = ServiceCallbackContract(AClass)* > > > > Then I added some debug messages in the Python.Net source code. > > > > I mean I want to create a class as the implementation of the interface > class which is declared by C# in a DLL file, I?m unable to change the code > in that DLL file. So is there any way to make it works for my purpose by > python.net? > > > > Thanks, > > > > Best regards, > > *Oscar Le* > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 42660 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 42660 bytes Desc: not available URL: From tony at pyxll.com Tue Apr 21 18:17:01 2015 From: tony at pyxll.com (Tony Roberts) Date: Tue, 21 Apr 2015 16:17:01 +0000 Subject: [Python.NET] Does python .net support creating a class inherited from an interface class declared by c#? In-Reply-To: References: <08BEF311A0DA2640820417971234FF37223BACC6@ALVMBXW01.prod.quest.corp> Message-ID: This is one of the features I added to this fork: https://github.com/renshawbay/pythonnet It's not yet integrated into the main repo, but you can build it from the source in github. Take a look at the test_subclass.py unit test here: https://github.com/renshawbay/pythonnet/blob/python3/src/tests/test_subclass.py Tony On Tue, Apr 21, 2015 at 4:56 PM Denis Akhiyarov wrote: > Does this work in Ironpython? > > On Tue, Apr 21, 2015, 10:33 AM Oscar Le > wrote: > >> Hi There, >> >> >> >> I want to create a class which can be inherited from an interface class >> declared by c#. But it throws TypeError when I instance it: ?object does >> not implement IServiceCallbackContract?. >> >> >> >> *class ServiceCallbackContract(IServiceCallbackContract):* >> >> * def __init__(self, c):* >> >> * pass* >> >> >> >> *object = ServiceCallbackContract(AClass)* >> >> >> >> Then I added some debug messages in the Python.Net source code. >> >> >> >> I mean I want to create a class as the implementation of the interface >> class which is declared by C# in a DLL file, I?m unable to change the code >> in that DLL file. So is there any way to make it works for my purpose by >> python.net? >> >> >> >> Thanks, >> >> >> >> Best regards, >> >> *Oscar Le* >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 42660 bytes Desc: not available URL: