Thanks for pointing out my error. I posted a wrong code. The problem is like this: $ python2.2 -c "import AA; print AA.AA().get1(1); print AA.A().get1(1)" 1.0 Traceback (most recent call last): File "<string>", line 1, in ? TypeError: bad argument type for built-in operation