I have two constructors in one class, but when I call one of them (a one with one argument - only self - instead of a one with 4 arguments), it results in an error, saying it expected more arguments than the 1 given.
The class is the following way:
class Message:
def __init__(self):
self.data = None
def __init__(self, type, length, data):
self.type = type
self.length = length
self.data = data
and the call to it (where I also get the error is at):
msg = Message()
Where might be the problem? Isn't it comparable to C++? If not, how can I still get the same result in another way?