This is actually not an answer, but a long comment:
Even more perplexing is that this code:
class A: def foo(x): print(x) A.foo(5)
Failure, as expected, in Python 2.7.3, but works fine in 3.2.3 (although you cannot call a method in instance A, only in the class.)
I will try to explain what is happening here.
This, strictly speaking, is an abuse of the usual instance method protocol.
Here you define a method, but with the first (and only) parameter, not named self , but x . Of course, you can call the method on instance A , but you will have to call it like this:
A().foo()
or
a = A() a.foo()
therefore, an instance is assigned to the function as the first argument.
The ability to call ordinary methods through a class has always been there and works
a = A() A.foo(a)
Here, when you call a class method, not an instance, it does not get its first parameter set automatically, but you have to provide it.
As long as this is instance A , everything is fine. Giving him something else is an abuse of the IMO protocol and therefore the difference between Py2 and Py3:
In Py2, A.foo converted to an unrelated method and therefore requires that its first argument be an instance of the class in which it "lives". Calling him with something else will fail.
In Py3, this check has been removed, and A.foo is only the original function object. So you can call it all as the first argument, but I would not do that. The first parameter of the method should always be called self and have the semantics of self .