Я пытаюсь вызвать функцию библиотеки C# из Python с помощью pythonnet.
def cb(node):
print(node)
code.Syntax.GetDescendants(cb)
Однако я получаю
Traceback (most recent call last):
File "/app/app/app.py", line 28, in
code.Syntax.GetDescendants(cb)
TypeError: No method matches given arguments for SyntaxElement.GetDescendants: ()
Также пробовал использовать Action и Func, но результаты такие же ошибки
from System import Action
code.Syntax.GetDescendants(Action[object](cb))
Traceback (most recent call last):
File "/app/app/app.py", line 28, in
code.Syntax.GetDescendants(cb)
TypeError: No method matches given arguments for SyntaxElement.GetDescendants: ()
e3322831a5b6:/app$ python app/app.py
Traceback (most recent call last):
File "/app/app/app.py", line 28, in
code.Syntax.GetDescendants(Action[object](cb))
~~~~~~^^^^^^^^
TypeError: type(s) expected
Подробнее здесь: https://stackoverflow.com/questions/790 ... -pythonnet