diff options
author | Ionel Cristian Maries <contact@ionelmc.ro> | 2015-02-14 18:13:20 +0200 |
---|---|---|
committer | Ionel Cristian Maries <contact@ionelmc.ro> | 2015-02-14 18:13:20 +0200 |
commit | 6d8412476a296b3a3691af1ffabcb672d9a4920f (patch) | |
tree | e358c7e886ff4d67d0efc6263f0472655efddfff /pylint/test/input/func_w0233.py | |
parent | 0369bd6a914af3ad92ce53eac3786bf8de785f7f (diff) | |
download | pylint-6d8412476a296b3a3691af1ffabcb672d9a4920f.tar.gz |
Move all package files to a pylint package.
Diffstat (limited to 'pylint/test/input/func_w0233.py')
-rw-r--r-- | pylint/test/input/func_w0233.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pylint/test/input/func_w0233.py b/pylint/test/input/func_w0233.py new file mode 100644 index 0000000..fe679bb --- /dev/null +++ b/pylint/test/input/func_w0233.py @@ -0,0 +1,50 @@ +# pylint: disable=R0903,W0212,W0403,W0406,no-absolute-import +"""test for call to __init__ from a non ancestor class +""" +from __future__ import print_function +__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) + +class Super(dict): + """ test late binding super() call """ + def __init__(self): + base = super() + base.__init__() + +class Super2(dict): + """ Using the same idiom as Super, but without calling + the __init__ method. + """ + def __init__(self): + base = super() + base.__woohoo__() |