1# mode: run 2 3class plop(object): 4 def __init__(self): 5 pass 6 7class testobj(object): 8 def __init__(self): 9 pass 10 11 def __eq__(self, other): 12 return plop() 13 14def test_equals(x): 15 """ 16 >>> x = testobj() 17 >>> result = test_equals(x) 18 >>> isinstance(result, plop) 19 True 20 >>> test_equals('hihi') 21 False 22 >>> test_equals('coucou') 23 True 24 """ 25 eq = x == 'coucou' # not every str equals returns a bool ... 26 return eq 27