call_uselessmethod
requires that there first be an instance of Class2
before you use it. However, by doing this:
k = Class2
you are not assigning k
to an instance of Class2
but rather Class2
itself.
To create an instance of Class2
, add ()
after the class name:
k = Class2()
k.call_uselessmethod()
Now, your code will work because k
points to an instance of Class2
like it should.