Before abc was introduced you would see this frequently.

class Base(object):
    def go(self):
        raise NotImplementedError("Please Implement this method")


class Specialized(Base):
    def go(self):
        print "Consider me implemented"
Answer from kevpie on Stack Overflow
🌐
Python
docs.python.org › 3 › library › abc.html
abc — Abstract Base Classes
In order to correctly interoperate with the abstract base class machinery, the descriptor must identify itself as abstract using __isabstractmethod__. In general, this attribute should be True if any of the methods used to compose the descriptor are abstract. For example, Python’s built-in property does the equivalent of:
Discussions

What's the point of ABC & @abstractmethod
So your examples are a bit problematic because you would never use @abstractmethod in that situation. In your example there is no reason not to define the function only in the parent class--the parent knows everything it needs in order to execute the function, and the children don't change the execution at all. Also, Abs is a terrible name for a class. @abstractmethod is for when you: Require all children to have a method Don't have enough information to define that method in the parent Essentially, it "requires" child classes to define this method. This allows you to include the method in your parent interface so you can document it but raises a sensible error if the child doesn't re-define it. This is mostly useful for parent classes that will never have direct instances--only instances of subclasses. Consider designing a shooter game like Doom or Quake. You might represent various objects and enemies as class instances. To keep the game synced, every clock tick all the objects need to "update" themselves. Enemies might move around, lights might blink, and items might recharge. They all need to do something, but what they do is completely unique to each class. In a case like this, you might define the update() method in the parent Object class. This is mostly a convenience feature--you can write the same code perfectly well without it. However, it allows you to refer to all objects collectively (isinstance(o, Object)) through the parent class, and still ensure that update() exists, even though the parent doesn't know what to do with it. You could easily define update() in the parent and have it do nothing, but this prevents errors from being raised if you call this on a child class that hasn't re-defined the method. More on reddit.com
🌐 r/learnpython
11
14
July 27, 2021
What's the point of abstract classes if they don't enforce method signatures?
Typically abstract classes are only used for libraries, where the end user might want to provide their own version of a class. The "abstract" concept is mainly to help IDE's/linters so that when someone implements the class, they can see what needs to be implemented. That being said, abstract classes are mainly just to help others, they should never be used to check that an object is an instance of the abstract class. This is python, not a strong OO language, and as such, you shouldn't enforce any strong OO. Python is about duck typing. The typical python rule is: "we are all adults here", which typically means "guidelines" and not enforcement. The method signatures for ABC's are the same way. Someone probably should match the function signature, but if they don't want to, they shouldn't have to. More on reddit.com
🌐 r/Python
14
4
December 18, 2016
oop - Abstract methods in Python - Stack Overflow
Is it good style to use an underscore for abstract methods, that would be protected in other languages? Would an abstract base class (abc) improve anything? ... In Python, you usually avoid having such abstract methods alltogether. More on stackoverflow.com
🌐 stackoverflow.com
Calling abstract methods - Typing - Discussions on Python.org
PEP 544 indicates that a type checker should generate an error if a class that explicitly derives from the protocol attempts to call a method through super() if that method is unimplemented in the protocol. class Proto(… More on discuss.python.org
🌐 discuss.python.org
1
January 6, 2024
🌐
GeeksforGeeks
geeksforgeeks.org › python › abstract-classes-in-python
Abstract Classes in Python - GeeksforGeeks
In Python, an abstract class is a class that cannot be instantiated on its own and is designed to be a blueprint for other classes. Abstract classes allow us to define methods that must be implemented by subclasses, ensuring a consistent interface ...
Published   September 3, 2025
🌐
Reddit
reddit.com › r/learnpython › what's the point of abc & @abstractmethod
r/learnpython on Reddit: What's the point of ABC & @abstractmethod
July 27, 2021 -

Hello. In this first example, I have a short and straightforward code w/ a class for interface. It doesn't inherit from ABC and doesn't have any abstract methods.

class Abs():
    def __init__(self, name, age):
        self.name = name
        self.age = age
        
    def go_to(self):
        return f"{self.name} is going to {self.place}."
        
class Teacher(Abs):
    place = "work"

class Student(Abs):
    place = "school"
    
t1 = Teacher("James", 56)
s1 = Student("Tim", 15)

print(t1.go_to())
print(s1.go_to())

In this second example, it's the exact opposite.

from abc import ABC, abstractmethod

class Abs(ABC):
    def __init__(self, name, age):
        self.name = name
        self.age = age
        
    @abstractmethod
    def go_to(self):
        ...
        
class Teacher(Abs):
    place = "work"
    
    def go_to(self):
        return f"{self.name} is going to {self.place}."

class Student(Abs):
    place = "school"
    
    def go_to(self):
        return f"{self.name} is going to {self.place}."
    
t1 = Teacher("James", 56)
s1 = Student("Tim", 15)

print(t1.go_to())
print(s1.go_to())

Both examples have the same output. In the tutorials/articles I've read, most times the second example is preferred. In the abstract class, abstract methods get defined and decorated, and then in the inheriting classes they all get redefined with the rest of the logic. What's the point of creating a class w/ abstract methods which later on we redefine? What issue does that solve? Why not just proceed as in the first example - simple, less code, one parent class for the interface, if we need to add other details, we do so in the base class once and handle the extra logic with that additional info there. Doesn't the first code present a better example of loose coupling - just one connection between parent and child classes, where in the second code, we get connections between parent/child in every method that we redefine? I feel like I'm missing something, because to me, the second example is much more spaghetti-like. If anyone can explain why it's a good practice to redefine abstract methods that would be nice. Also, is it a bad practice to write code as in the first example, w/o ABC+@abstractmethod in the parent class?
Thanks.

Top answer
1 of 5
10
So your examples are a bit problematic because you would never use @abstractmethod in that situation. In your example there is no reason not to define the function only in the parent class--the parent knows everything it needs in order to execute the function, and the children don't change the execution at all. Also, Abs is a terrible name for a class. @abstractmethod is for when you: Require all children to have a method Don't have enough information to define that method in the parent Essentially, it "requires" child classes to define this method. This allows you to include the method in your parent interface so you can document it but raises a sensible error if the child doesn't re-define it. This is mostly useful for parent classes that will never have direct instances--only instances of subclasses. Consider designing a shooter game like Doom or Quake. You might represent various objects and enemies as class instances. To keep the game synced, every clock tick all the objects need to "update" themselves. Enemies might move around, lights might blink, and items might recharge. They all need to do something, but what they do is completely unique to each class. In a case like this, you might define the update() method in the parent Object class. This is mostly a convenience feature--you can write the same code perfectly well without it. However, it allows you to refer to all objects collectively (isinstance(o, Object)) through the parent class, and still ensure that update() exists, even though the parent doesn't know what to do with it. You could easily define update() in the parent and have it do nothing, but this prevents errors from being raised if you call this on a child class that hasn't re-defined the method.
2 of 5
3
let's imagine a List interface - we'll have the operations of append and pop class List(ABC): @abstractmethod def append(self, val): pass @abstractmethod def pop(self): pass now we could create class LinkedList(List) and class ArrayList(List) where we'd implement the methods for both of the list types the reason for using ABC and @abstractmethod is because it doesn't make sense to be able to be able to instantiate a List - that doesn't have an implementation. it only describes what behaviour an implementation should have to provide. think of it as providing a contract by which all users of an object know what behaviour to expect abstract classes and methods are more useful in languages such as java where you can't rely on duck typing void doThing(List list) this would take any subclass of List and be checked at compile time to have the expected methods of append and pop
🌐
CodeSignal
codesignal.com › learn › courses › revisiting-oop-concepts-in-python › lessons › understanding-abstract-classes-and-abstract-methods-in-python
Understanding Abstract Classes and Abstract Methods in ...
Think of it as a blueprint for other classes. It often includes one or more abstract methods. A class that inherits from an abstract class must implement all its abstract methods. In Python, the abc (Abstract Base Classes) module provides tools for defining abstract base classes.
🌐
Medium
medium.com › @prashampahadiya9228 › abstract-classes-and-abstract-methods-in-python-e632ea34bc79
Abstract Classes and Abstract Methods in Python | by Prasham Pahadiya | Medium
May 31, 2024 - Abstract Classes An abstract class is a class that is meant to be subclassed but not instantiated directly. It can include one or more abstract methods. In Python, abstract classes are created using the `abc` module, specifically the `ABC` class.
Find elsewhere
🌐
DataCamp
datacamp.com › tutorial › python-abstract-classes
Python Abstract Classes: A Comprehensive Guide with Examples | DataCamp
January 22, 2025 - If you're new to Python, you can learn how to work with modules and packages, work with built-in data types, and write custom functions with our skill track. An abstract class is like a template for other classes. It defines methods that must be included in any class that inherits from it, but it doesn’t provide the actual code for those methods.
🌐
Reddit
reddit.com › r/python › what's the point of abstract classes if they don't enforce method signatures?
r/Python on Reddit: What's the point of abstract classes if they don't enforce method signatures?
December 18, 2016 -

I was surprised to see the Python abstract classes don't enforce anything except the override and method name. I can see why in Python enforcing parameter data-types would probably not work, but the number of parameters and parameter names ought to be enforced.

I've always thought the point of abstract classes was to ensure that any inheritor of the class would would work with existing code to run the abstract methods defined in the super class. The whole point was to enforce method signatures.

It seems to me that Python's implantation of abstract classes has very little utility. Does anyone even use them? What for?

🌐
Python.org
discuss.python.org › typing
Calling abstract methods - Typing - Discussions on Python.org
January 6, 2024 - PEP 544 indicates that a type checker should generate an error if a class that explicitly derives from the protocol attempts to call a method through super() if that method is unimplemented in the protocol. class Proto(Protocol): def method(self) -> None: ... class Impl(Proto): def method(self) -> None: super().method() # Type checker error This makes sense because the method in the protocol is effectively abstract.
🌐
W3Schools
w3schools.com › python › ref_module_abc.asp
Python abc Module
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... from abc import ABC, abstractmethod class Shape(ABC): @abstractmethod def area(self): pass class Square(Shape): def __init__(self, s): self.s = s def area(self): return self.s * self.s sq = Square(3) print(isinstance(sq, Shape)) print(sq.area()) Try it Yourself » · The abc module provides tools for creating Abstract Base Classes (ABCs) and decorators for abstract methods.
🌐
GeeksforGeeks
geeksforgeeks.org › python › data-abstraction-in-python
Data Abstraction in Python - GeeksforGeeks
In Python, an Abstract Base Class (ABC) is used to achieve data abstraction by defining a common interface for its subclasses. It cannot be instantiated directly and serves as a blueprint for other classes.
Published   January 22, 2026
🌐
Python Course
python-course.eu › oop › the-abc-of-abstract-base-classes.php
20. The 'ABC' of Abstract Base Classes | OOP | python-course.eu
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation.
🌐
Medium
medium.com › @abhishekjainindore24 › embracing-abstraction-a-dive-into-abstract-classes-in-python-0faf6d83948d
Embracing Abstraction: A Dive into Abstract Classes in Python | by Abhishek Jain | Medium
September 8, 2024 - The ABC (Abstract Base Class) meta-class, along with the @abstractmethod decorator, facilitates the definition of abstract methods. from abc import ABC, abstractmethod class AbstractClass(ABC): @abstractmethod def abstract_method(self): pass
🌐
Python
peps.python.org › pep-3119
PEP 3119 – Introducing Abstract Base Classes | peps.python.org
The abc module also defines a new decorator, @abstractmethod, to be used to declare abstract methods. A class containing at least one method declared with this decorator that hasn’t been overridden yet cannot be instantiated. Such methods may be called from the overriding method in the subclass (using super or direct invocation).
🌐
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. ABCs allow you to define methods that must be created within any subclasses built from the abstract base class.
🌐
Scaler
scaler.com › home › topics › abstract class in python
Abstract Class in Python - Scaler Topics
April 9, 2024 - The module we can use to create an abstract class in Python is abc(abstract base class) module. Abstract methods force the child classes to give the implementation of these methods in them and thus help us achieve abstraction as each subclass can give its own implementation.
🌐
LinkedIn
linkedin.com › all › customer-premises equipment (cpe)
How do you implement abstract methods and polymorphism in Python oop?
March 8, 2023 - Abstract methods enforce a consistent interface for subclasses and ensure that they provide their own implementation of the method. To create an abstract method in Python, you need to import the abstract base class (ABC) module and use the @abstractmethod decorator.
🌐
Medium
medium.com › @ankitlodh2002 › exploring-pythons-abstraction-abstract-methods-decorators-and-magic-methods-demystified-2c6ec5e14dce
Exploring Python’s Abstraction: Abstract Methods, Decorators, and Magic Methods Demystified | by Ankit Lodh | Medium
December 16, 2023 - Before delving into the construction of custom abstract methods, it is essential to explore the realm of magic or ‘dunder’ methods in Python — a pivotal concept laying the groundwork for the creation of your unique abstract methods. These methods play a crucial role in defining how the objects will behave in various contexts such as instantiation, string representation, and arithmetic operations.
🌐
StrataScratch
stratascratch.com › blog › what-is-a-python-abstract-class
What Is a Python Abstract Class? When and How to Use It - StrataScratch
June 5, 2025 - You never create a direct object or an “instance” from this abstract class. The primary purpose involves setting out a common structure. This defines some rules plus methods that other, more concrete classes will eventually follow.