jeudi 17 septembre 2020

Inspect in python (Migration from Java to Python)

I m working on a java project where I'm using :

myMethodObj = MyClass.class.getMethod(methodName, methodParameter);

(myMethodObj is of type Method (Java reflection API))

I'm using java reflection API here, I want to write this code in python. What will be the way ?

I have tried using inspect.getmembers and MyClass.__dir__ . But Its not working.

Aim is to get the method name (declared inside MyClass) and the parameter list of the method(in Array)

Please help!!





Aucun commentaire:

Enregistrer un commentaire