Answer the question
In order to leave comments, you need to log in
Why can't **kwargs accept a dictionary with an int key?
def tst_func(**kwargs):
print(kwargs)
d = dict((('t', 2), (2, 2),))
print(d)
tst_func(**d)
Traceback (most recent call last):
File "main.py", line 22, in
tst_func(**d)
TypeError: tst_func() keywords must be strings
Answer the question
In order to leave comments, you need to log in
Because, in python functions, a number cannot be a name for an argument. You are clearly written about this in an error
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question