[Solution] Python: Get rid of errors like: TypeError: takes exactly 1 argument (2 given)

If you get exceptions like
TypeError: myFunction() takes exactly 1 argument (2 given)
in Python, they probably result from code parts like
class myClass: def myFunction(myParameter):
that cause the interpreter to fire this strange error message into your debugging console. To solve this problem you simply have to add a further parameter to your function:
class myClass: def myFunction(self, myParameter):

Comments

Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Java 8: Default Interface Implementations, The Diamond Problem, Multiple Inheritance, and Precedence

Tuning ext3 for performance without losing its data integrity potential