Skip to content
Advertisement

How can I read a function’s signature including default argument values?

Given a function object, how can I get its signature? For example, for:

JavaScript

I would like to get "my_method(first, second, third='something')".

Advertisement

Answer

JavaScript

Python 3.5+ recommends inspect.signature().

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement