[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: The error message is correct. The bug is in your code. Also, the code you tell us that you are running is not the same as the code you are actually running. You should not call __init__ directly as you do: # this is wrong Person.__init__("Some","One

[issue36574] Error with self in python

2019-04-09 Thread Tommy
Joan Tomas (Tommy) Pujol Muñoz added the comment: The python file. It works in Linux (Ubuntu) but not in Windows; at least for me. The output error is : Traceback (most recent call last): File "pySelf.py", line 8, in print(Person.__init__("Some","One",21,"American")) TypeError: __init__(

[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: The file you have attached doesn't seem to be a Python script, it seems to be some sort of Windows batch file or similar. Please supply an actual Python file. (Hint: remove the "del code.py" line from your batch file.) Also, copy and paste the traceback you

[issue36574] Error with self in python

2019-04-09 Thread Tommy
New submission from Joan Tomas (Tommy) Pujol Muñoz : I try to use self with the __init__ function in a class, but when I enter the other values e.g. def __init__(self, name): self.name = name /// and when I call the class with a name it says that it need another value because it uses self an a