def test_java_lang_object_methods(self): # Passing a PyFunction to Object.toString, .hashCode, etc # should not result in the function itself being called def return42(): return 42 s = Object.toString(return42) self.assertNotEqual(s, 42) self.assertTrue(s.startswith('<function return42'))
def toString(self): return "Override " + Object.toString(self)