If you ever write code that needs to process mixed types, some of which might define the API method, but which shouldn't be considered "validators", having a common base class for "true" validators might be helpful for checking types ahead of time and only processing the "true" validators, not just "things that look like validators". That said, the more complex the method name, the less likely you are to end up with this sort of confusion; the odds of a different type implementing a really niche method name by coincidence are pretty small.

That said, that's a really niche use case. Often, as you can see, Python's duck-typing behavior is good enough on its own; if there is no common functionality between the different types, the only meaningful advantages to having the abstract base class are for the developer, not the program itself:

  1. Having a common point of reference for the API consumer makes it clear what methods they can expect to have access too
  2. For actual ABCs with @abstractmethod decorated methods, it provides a definition-time check for subclasses, making it impossible for maintainers to omit a method by accident
Answer from ShadowRanger on Stack Overflow
🌐
W3Schools
w3schools.com β€Ί python β€Ί python_inheritance.asp
Python Inheritance
Python Examples Python Compiler ... class that inherits all the methods and properties from another class. Parent class is the class being inherited from, also called base class....
🌐
Python documentation
docs.python.org β€Ί 3 β€Ί tutorial β€Ί classes.html
9. Classes β€” Python 3.14.3 documentation
It is a mixture of the class mechanisms found in C++ and Modula-3. Python classes provide all the standard features of Object Oriented Programming: the class inheritance mechanism allows multiple base classes, a derived class can override any methods of its base class or classes, and a method can call the method of a base class with the same name.
🌐
Python
docs.python.org β€Ί 3 β€Ί library β€Ί abc.html
abc β€” Abstract Base Classes
Source code: Lib/abc.py This module provides the infrastructure for defining abstract base classes(ABCs) in Python, as outlined in PEP 3119; see the PEP for why this was added to Python. (See also ...
🌐
Real Python
realpython.com β€Ί ref β€Ί glossary β€Ί base-class
base class | Python Glossary – Real Python
A base class, also known as a superclass or parent class, is a class from which other classes inherit attributes (data) and behaviors (methods).
🌐
DEV Community
dev.to β€Ί dollardhingra β€Ί understanding-the-abstract-base-class-in-python-k7h
Beginner's guide to abstract base class in Python - DEV Community
June 1, 2021 - Imagine that you are creating a game in which you have different animals. For defining animals you can have an abstract class called Animal. A Dog/Cat/Duck are all the classes that are derived from the base class Animal.
🌐
Programiz
programiz.com β€Ί python-programming β€Ί inheritance
Python Inheritance (With Examples)
Being an object-oriented language, ... created class is known as the subclass (child or derived class). The existing class from which the child class inherits is known as the superclass (parent or base class)....
Top answer
1 of 2
3

If you ever write code that needs to process mixed types, some of which might define the API method, but which shouldn't be considered "validators", having a common base class for "true" validators might be helpful for checking types ahead of time and only processing the "true" validators, not just "things that look like validators". That said, the more complex the method name, the less likely you are to end up with this sort of confusion; the odds of a different type implementing a really niche method name by coincidence are pretty small.

That said, that's a really niche use case. Often, as you can see, Python's duck-typing behavior is good enough on its own; if there is no common functionality between the different types, the only meaningful advantages to having the abstract base class are for the developer, not the program itself:

  1. Having a common point of reference for the API consumer makes it clear what methods they can expect to have access too
  2. For actual ABCs with @abstractmethod decorated methods, it provides a definition-time check for subclasses, making it impossible for maintainers to omit a method by accident
2 of 2
2

Base classes in Python serve to share implementation details and document likenesses. We don't need to use a common base class for things that function similarly though, as we use protocols and duck typing. For these validation functions, we might not have a use for a class at all; Java is designed to force people to put everything inside classes, but if all you have in your class is one static method, the class is just noise. Having a common superclass would enable you to check dynamically for that using isinstance, but then I'd really wonder why you're handling them in a context where you don't know what they are. For a programmer, the common word in the function name is probably enough.

🌐
Python
docs.python.org β€Ί 3.4 β€Ί library β€Ί abc.html
29.7. abc β€” Abstract Base Classes β€” Python 3.4.10 documentation
This document is for an old version of Python that is no longer supported. You should upgrade, and read the Python documentation for the current stable release. ... This module provides the infrastructure for defining abstract base classes (ABCs) in Python, as outlined in PEP 3119; see the PEP for why this was added to Python.
Find elsewhere
🌐
Codefellows
codefellows.github.io β€Ί sea-python-401d4 β€Ί lectures β€Ί inheritance_v_composition.html
Python Classes: Inheritance v. Composition β€” Python 401 2.1 documentation
This basic class sits at the top of the Python data model, and is in the __builtin__ namespace. This is a pseudocode model for the simplest subclass in Python: ... When we put object in the base class list, it means we are inheriting from object – getting the core functionality of all objects.
🌐
Real Python
realpython.com β€Ί ref β€Ί glossary β€Ί abstract-base-class
abstract base class (ABC) | Python Glossary – Real Python
In Python, an abstract base class (ABC) is a class that can’t be instantiated on its own and is designed to be a blueprint for other classes, allowing you to define a common interface for a group of related classes.
🌐
Medium
medium.com β€Ί @gauravverma.career β€Ί inheritance-in-python-a7aaf1d41971
Inheritance in Python | by Gaurav Verma | Medium
December 7, 2025 - Inheritance in Python Inheritance is a mechanism that allows a derived (child) class to inherit properties and methods from a base (parent) class. Python Inheritance Syntax is class BaseClass: …
🌐
Real Python
realpython.com β€Ί inheritance-composition-python
Inheritance and Composition: A Python OOP Guide – Real Python
January 11, 2025 - Composition and inheritance in Python model relationships between classes, enabling code reuse in different ways. Composition is achieved by creating classes that contain objects of other classes, allowing for flexible designs. Inheritance models an is a relationship, allowing derived classes to extend base class functionality.
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί in inheritance, is it considered bad practice to define a base class which cannot be used except for when defining derived classes?
r/learnpython on Reddit: In inheritance, is it considered bad practice to define a base class which cannot be used except for when defining derived classes?
April 22, 2022 -

I am working on a few projects at the moment which I think could really benefit from inheritance. However, the derived classes are really not that similar except for a couple of methods that they both require.

In this case, is it considered bad practice to define a base class that cannot be used by itself, but can only be used in the context of inheritance? Here's a stripped-back (and pointless) example of what I mean:

class _incompleteBase:
    def __init__(self):
        pass

    def common_method(self):
        print(self.val)


class child1(_incompleteBase):
    def __init__(self, val):
        super().__init__()
        # Definitions only required by child1
        self.val = val

class child2(_incompleteBase):
    def __init__(self, val):
        super().__init__()
        # Definitions only required by child2
        self.val = val


if __name__ == "__main__":
    c1 = child1(6)
    c2 = child2(7)
    c1.common_method()
    c2.common_method()

Here I have _incompleteBase, which is inherited by derived classes child1 and child2. This code works for me. However, the following will obviously throw an error:

# AttributeError: '_incompleteBase' object has no attribute 'val'
if __name__ == "__main__":
    ib = _incompleteBase()
    ib.common_method()

_incompleteBase will never be used like this in my projects, and to do so would be a 'misuse' of this class as far as I'm concerned.

However, I'd be interested in hearing other people's views on this. Is this OK to do, or is this bad practice?

🌐
DataCamp
datacamp.com β€Ί tutorial β€Ί python-inheritance
Python Inheritance: Best Practices for Reusable Code | DataCamp
February 12, 2025 - With this approach, shared functionality stays in one place (the Person class), while specialized behavior is neatly encapsulated in the subclasses. Hybrid inheritance combines multiple inheritance types, such as multilevel or multiple inheritance, to model more complex relationships. Hybrid inheritance. Image by Author Β· Let’s look at an example that shows the complexity of hybrid inheritance. # Base class class Person: def __init__(self, name, id): self.name = name self.id = id def get_details(self): return f"Name: {self.name}, ID: {self.id}" # Intermediate class inheriting from the base
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί inheritance-in-python
Inheritance in Python - GeeksforGeeks
Inheritance is a fundamental concept in object-oriented programming (OOP) that allows a class (called a child or derived class) to inherit attributes and methods from another class (called a parent or base class). In this article, we'll explore inheritance in Python.
Published Β  October 9, 2025
🌐
Built In
builtin.com β€Ί software-engineering-perspectives β€Ί python-inheritance
Python Class Inheritance Explained | Built In
The class that has the methods and attributes that will be inherited by another class is called the parent class. Other names for the parent class that you may come across are base class and superclass.
🌐
Stack Overflow
stackoverflow.com β€Ί questions β€Ί 61005548 β€Ί user-defined-base-class-in-python
inheritance - user defined base class in python - Stack Overflow
class baseclass(object): def __init__(self): raise NotImplementedError("this is an abstract class") def __enter__(self): raise NotImplementedError("this is an abstract class") def __exit__(self, exc_type, exc_value, traceback): raise NotImplementedError("this is an abstract class") class Myclass(baseclass): def __init__(self): "" def __enter__(self): "" def __exit__(self, exc_type, exc_value, traceback): "" def method1(self): pass
🌐
DigitalOcean
digitalocean.com β€Ί community β€Ί tutorials β€Ί understanding-class-inheritance-in-python-3
Understanding Class Inheritance in Python 3 | DigitalOcean
August 20, 2021 - Parent or base classes create a pattern out of which child or subclasses can be based on. Parent classes allow us to create child classes through inheritance without having to write the same code over again each time.