To create the instance, you need to call the class, k = Class2()
.
What was really happening the that k = Class2
created an alias to the class and
k.call_uselessmethod`` created an unbound method which requires that you pass in the instance as the argument.
Here is a session that explains exactly what is happening:
>>> k = Class2 # create an alias the Class2
>>> k == Class2 # verify that *k* and *Class2* are the same
True
>>> k.call_uselessmethod # create an unbound method
<unbound method Class2.call_uselessmethod>
>>> k.call_uselessmethod() # call the unbound method with the wrong arguments
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
k.call_uselessmethod() # call the unbound method with the wrong arguments
TypeError: unbound method call_uselessmethod() must be called with Class2 instance as first argument (got nothing instead)
Note, the error message in Python2.7.6 has been improved over what you were seeing :-)