You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public interface ITestLogger
{
void doStuff<T>(T data);
}
Note: The interface is not generic, the doStuff method is
I then create a concrete implementation of ITestLogger in python like this
class TestLogger(ITestLogger):
__namespace__ = "StringPrinterSDK" # Must match the namespace of the interface
def doStuff(self, data):
print("Stuff")
print(data)
return data;
tester = TestLogger()
tester.doStuff("Different Stuff")
When I run the python code, I get the following exception
Method 'doStuff' in type 'StringPrinterSDK.TestLogger' from assembly 'Python.Runtime.Dynamic, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Stack trace:
> File "C:\Users\sfroehlich\Code\sfroehlich-pythonnet\src\PythonProgram\PythonProgram.py", line 92, in <module> (Current frame)
> class TestLogger(ITestLogger):
Loaded '__main__'
Loaded 'runpy'
The program 'python.exe' has exited with code 4294967295 (0xffffffff).
I can't seem to figure out how to define doStuff so that it implements the interface correctly. Any help would be appreciated!
Note 2: The goal of the project is to implement the ILogger interface, so I can't change the generic method
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Let's say I have a C# interface defined like this
Note: The interface is not generic, the
doStuffmethod isI then create a concrete implementation of
ITestLoggerin python like thisWhen I run the python code, I get the following exception
I can't seem to figure out how to define
doStuffso that it implements the interface correctly. Any help would be appreciated!Note 2: The goal of the project is to implement the ILogger interface, so I can't change the generic method
All reactions