V
V
Vladimir2020-05-12 20:36:33
Python
Vladimir, 2020-05-12 20:36:33

Is there an array of function arguments in python like in js?

In js, you can get function arguments in an array. I searched the Internet for nothing about python, there are only arguments of arbitrary length.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly, 2020-05-13
@akifai

import inspect

def bar(arg1, arg2):
    print(inspect.signature(bar))

def foo(a,b,c=4, *arglist, **keywords):
    print(inspect.signature(foo))

D
Dr. Bacon, 2020-05-12
@bacon

I suspect aboutdef func(*args, **kwargs):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question