1

I am new to Python and wonder where can I can all the available arguments for the FunctionType in the types package?

I can found the related source code in here: https://github.com/python/cpython/blob/3.9/Lib/types.py

But I don't find clear definition of FunctionType.

wwj123
  • 365
  • 2
  • 12

1 Answers1

-1

use inspect.getargspec

>>> import inspect
>>> def foobar(foo, bar, baz):
...     return inspect.getargspec(foobar)
... 
>>> foobar(1, 2, 3)
ArgSpec(args=['foo', 'bar', 'baz'], varargs=None, keywords=None, defaults=None)

check this for reference:

AmaanK
  • 1,032
  • 5
  • 25