QUERY · ISSUE
function doesn't take keyword arguments in micropython
py-core
i=10
i.to_bytes(1,byteorder='little') * 4
CANDIDATE · ISSUE
unix: "function does not take keyword arguments" message can mislead
If function kw arguments are supplied from a dict, and the dict (erroneously) contains unexpected arguments, the above error message is rather misleading.
d = {'argument' : 'A', 'bar' : 0}
def foo(*, bar=False):
print('foo')
foo(**d)
Cpython produces the self-evident
>>> foo(**d)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() got an unexpected keyword argument 'argument'
>>>