summaryrefslogtreecommitdiff
path: root/test/input/func_w0233.py
blob: 857743aadede62ca49fef2b18e14d30a5fd011a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# pylint: disable=R0903,W0212,W0403,W0406
"""test for call to __init__ from a non ancestor class
"""

__revision__ = '$Id: func_w0233.py,v 1.2 2004-09-29 08:35:13 syt Exp $'

class AAAA(object):
    """ancestor 1"""

    def __init__(self):
        print 'init', self
        BBBBMixin.__init__(self)

class BBBBMixin(object):
    """ancestor 2"""

    def __init__(self):
        print 'init', self

import nonexistant
import func_w0233
class CCC(BBBBMixin, func_w0233.AAAA, func_w0233.BBBB, nonexistant.AClass):
    """mix different things, some inferable some not"""
    def __init__(self):
        BBBBMixin.__init__(self)
        func_w0233.AAAA.__init__(self)
        func_w0233.BBBB.__init__(self)
        nonexistant.AClass.__init__(self)

class DDDD(AAAA):
    """call superclass constructor in disjunct branches"""
    def __init__(self, value):
        if value:
            AAAA.__init__(self)
        else:
            AAAA.__init__(self)