I’m working on making a plugin, and I want to allow the user to bind arbitrary callables. For type safety, I want to know what the signature of the arguments is (i.e. the argument count, the types of the arguments, arg names, etc.)
Unfortunately, the Callable object doesn’t seem to have any way of doing this. Is there any method to get this data from an arbitrary callable?
I don’t know much about this, but have you tried calling get_bound_arguments() on the callable?
You may have to keep a dict of the data you need so that you can reconstruct that in other places.
That function just returns the arguments that have been given to the function, it doesn’t work for my purpose sadly
I think this may be what I need to do. Just wish there was a way to automatically handle it.