← index #8414Issue #4937
Related · medium · value 3.877
QUERY · ISSUE

function doesn't take keyword arguments in micropython

openby SamRoy259opened 2022-03-14updated 2023-04-30
py-core

i=10
i.to_bytes(1,byteorder='little') * 4

CANDIDATE · ISSUE

Mixin failing on kwargs

closedby Sultopened 2019-07-20updated 2019-07-21

I am pretty complexed
I am working with some class inheritance, and for some reason my init keeps erroring out with the message:
TypeError: function doesn't take keyword arguments

To try it out, i set all init methods to just be *args ,**kwargs, but i am still getting the same error
Below is a snippet of my code
https://gist.github.com/Sult/0108386e1d530a509ce8bcdc4f147af5

When i use 1 args:
sens = Waterpump(0)

function takes one positional arguments but 2 where given

if i use 1 named argument
function doesnt take keyword arguments

only when i use no input at all, it passes.

Can someone please explain what i am missing here?

`

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied