def testInstClass(self): #{{{ '''Retrieve method name from instance or class''' class _(object): #{{{ def me(self): #{{{ pass # End def #}}} # End class #}}} for meth in (_.me, _().me): ret = methodname(meth) self.assertEqual(ret, 'me')
def testNonInstClass(self): #{{{ '''Non-method instance/class objects returns None''' nonmeth = lambda s: None unbound = method(nonmeth, None, None) for nm in (nonmeth, unbound): self.assertTrue(methodname(nm) is None)