]> granicus.if.org Git - python/commitdiff
Add test for SF bug #442833 (multiple inheritance).
authorGuido van Rossum <guido@python.org>
Fri, 10 Aug 2001 21:28:46 +0000 (21:28 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 10 Aug 2001 21:28:46 +0000 (21:28 +0000)
Lib/test/test_descr.py

index 9f731cdcc8c225e031aa88fa59cc788d8af40886..737fce9b719773034fd7835969f673c247f0fe3a 100644 (file)
@@ -441,6 +441,20 @@ def multi():
     verify(d.getstate() == 10)
     verify(D.__mro__ == (D, dictionary, C, object))
 
+    # SF bug #442833
+    class Node(object):
+        def __int__(self):
+            return int(self.foo())
+        def foo(self):
+            return "23"
+    class Frag(Node, list):
+        def foo(self):
+            return "42"
+    verify(Node().__int__() == 23)
+    verify(int(Node()) == 23)
+    verify(Frag().__int__() == 42)
+    verify(int(Frag()) == 42)
+
 def diamond():
     if verbose: print "Testing multiple inheritance special cases..."
     class A(object):