mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Add test for SF bug #442833 (multiple inheritance).
This commit is contained in:
parent
61cf780b6d
commit
e45763a8e6
1 changed files with 14 additions and 0 deletions
|
|
@ -441,6 +441,20 @@ def multi():
|
||||||
verify(d.getstate() == 10)
|
verify(d.getstate() == 10)
|
||||||
verify(D.__mro__ == (D, dictionary, C, object))
|
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():
|
def diamond():
|
||||||
if verbose: print "Testing multiple inheritance special cases..."
|
if verbose: print "Testing multiple inheritance special cases..."
|
||||||
class A(object):
|
class A(object):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue