I am trying to port to python3 this answer. But I am not sure how to set theThread.__init__
function in python3.
The deceleration of a python2 Thread.__init__
in a thread class is:
Thread.__init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None)
But python3 its:
Thread.__init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None)
Note: The ending in python3 is: args=(), kwargs=None, *, daemon=None)
Part of the problem is I don't understand how to treat the asterisk *
in the function deceleration. Explaining what it is for would also be helpful.
Just using the python2 raises: TypeError: __init__() takes from 1 to 6 positional arguments but 7 were given
How should I write the python3 Thread.__init__
?
Update, the python2 call in the example is:
Thread.__init__(self, group, target, name, args, kwargs, Verbose)
How so my logic would say this would work in python3, but it doesn't, the answer should include how to call this, or instructions how to build it, including kwargs:
Thread.__init__(self, group, target, name, args, kwargs, daemon)