summaryrefslogtreecommitdiff
path: root/pylint/test/functional/useless_object_inheritance.py
blob: 562c81f6a73eadc08effded3b964fce47dec496f (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
"""Check if a class inherits from object.
In python3 every class implicitly inherits from object, therefore give refactoring message to
 remove object from bases"""
# pylint: disable=no-init, invalid-name, missing-docstring, too-few-public-methods
# pylint: disable=inconsistent-mro
import abc

class A(object):    # [useless-object-inheritance]
    pass

class B:
    pass

class C(B, object): # [useless-object-inheritance]
    pass

class D(object, C, metaclass=abc.ABCMeta):   # [useless-object-inheritance]
    pass

class E(D, C, object, metaclass=abc.ABCMeta):   # [useless-object-inheritance]
    pass

class F(A): # positive test case
    pass

class G(B): # positive test case
    pass