.. _NoInheritFromObjectRule:

=======================
NoInheritFromObjectRule
=======================

In Python 3, a class is inherited from ``object`` by default.
Explicitly inheriting from ``object`` is redundant, so removing it keeps the code simpler.

-------
Message
-------
Inheriting from object is a no-op.  'class Foo:' is just fine =)

----------------
Has Autofix: Yes
----------------

-------------------
VALID Code Examples
-------------------

# 1:







.. code-block:: python

            class A(something):    pass




# 2:







.. code-block:: python


    class A:
        pass




---------------------
INVALID Code Examples
---------------------

# 1:







.. code-block:: python


    class B(object):
        pass




Autofix:

.. code-block:: python

    --- 
    +++ 
    @@ -1,3 +1,3 @@
 
    -class B(object):
    +class B:
         pass

# 2:







.. code-block:: python


    class B(object, A):
        pass




Autofix:

.. code-block:: python

    --- 
    +++ 
    @@ -1,3 +1,3 @@
 
    -class B(object, A):
    +class B(A):
         pass
