Jython: Determine the number of arguments a Java method takes at runtime
问题 I'm trying to write an object inspector for Java objects in Jython, and I want to determine how many arguments a given Java method expects. Is there any way to do that in python, or do I have to use Java reflection for that. To explain, I'd like to call all "get..." methods of a Java object that don't take any arguments: from java.util import Date, ArrayList def numberOfArguments(fct): # Some magic happens here return 0 def check(o): print("") print(type(o).name) for fctName in dir(o): if not