This issue comes from this StackOverflow question.
I was trying to use a C# DLL which has a class that overrides a non-abstract method of its parent class. Although the new method should be used, pythonnet still calls the parent method. The code for a minimal DLL to reproduce this problem looks like this:
In the following python code, BaseClass.Transmit should be called when BaseClass is directly instantiated and InheritedClass.Transmit when InheritedClass is instantiated. However, BaseClass.Transmit is called both times.
## setupimportclrimportosclr.AddReference(os.getcwd() +'\\InheritanceTest.dll')
importInheritanceTest## method testbase_class=InheritanceTest.BaseClass()
base_class.Transmit() # throws a NotImplementedException as expectedinherited_class=InheritanceTest.InheritedClass()
inherited_class.Transmit() # still throws a NotImplementedException, although it should call InheritedClass.Transmit
@denfromufa It seems to me that #552 is the exact same issue (although worded a little strangely in my opinion, i wasn't able to find it when first researching the problem). #756 fixes #552 too.
Activity
den-run-ai commented on Oct 21, 2018
@bminixhofer related #552?
bminixhofer commented on Oct 23, 2018
@denfromufa It seems to me that #552 is the exact same issue (although worded a little strangely in my opinion, i wasn't able to find it when first researching the problem).
#756 fixes #552 too.