---
source: https://iinventedlight.com/library/notes/python-abc.md
title: "Python abc defines abstract base classes that cannot be instantiated until abstract methods are overridden"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF-2.0 (Python docs (library)); Public-Domain (Python PEPs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python docs (library), abc — Abstract Base Classes; Python PEPs, PEP 3119 – Introducing Abstract Base Classes. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Public-Domain (https://peps.python.org/pep-0001/). PEP text is placed in the public domain (some also CC0-1.0)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: abc module"
tags: [python, abc, ABC, abstractmethod, ABCMeta, register]
client: Librarian
sources:
  - id: S1
    title: "abc — Abstract Base Classes"
    publisher: Python docs (library)
    url: https://docs.python.org/3/library/abc.html
    accessed: 2026-11-18
    license: "PSF-2.0"
  - id: S2
    title: "PEP 3119 – Introducing Abstract Base Classes"
    publisher: Python PEPs
    url: https://peps.python.org/pep-3119/
    accessed: 2026-11-18
    license: "Public-Domain"
---
# Python abc defines abstract base classes that cannot be instantiated until abstract methods are overridden
**Answer:** Create an abstract base class by deriving from the helper class `ABC`, and use the `@abstractmethod` decorator on abstract methods. A class with a metaclass derived from `ABCMeta` cannot be instantiated unless all of its abstract methods are overridden. `register(subclass)` registers a virtual subclass of the ABC.

## Example

```python
from abc import ABC, abstractmethod

class Store(ABC):
    @abstractmethod
    def get(self, key): ...

class MemStore(Store):
    def get(self, key):
        return None

MemStore()   # ok
Store()      # TypeError
Store.register(dict)   # dict is now a virtual subclass
```

## Facts

- For defining ABCs, the module provides the metaclass `ABCMeta`, plus a helper class `ABC` for defining ABCs through inheritance.
- `ABC` is a helper class that has `ABCMeta` as its metaclass, so an abstract base class can be created by simply deriving from `ABC`.
- `@abstractmethod` is a decorator indicating abstract methods; using it requires that the class's metaclass is `ABCMeta` or is derived from it.
- `register(subclass)` registers subclass as a "virtual subclass" of this ABC.

## Origin

PEP 3119 was a proposal to add Abstract Base Class (ABC) support to Python 3000, including ABCs for containers and iterators.

## See also

- [python-typing-annotations](https://iinventedlight.com/library/notes/python-typing-annotations/)
- [python-dataclasses](https://iinventedlight.com/library/notes/python-dataclasses/)
- [python-exceptions-hierarchy](https://iinventedlight.com/library/notes/python-exceptions-hierarchy/)

## Claims

- id: C1
  claim: ABC is a helper class with ABCMeta as its metaclass.
  source: S1
  evidence: "A helper class that has ABCMeta as its metaclass."

- id: C2
  claim: abstractmethod is a decorator indicating abstract methods.
  source: S1
  evidence: "A decorator indicating abstract methods."

- id: C3
  claim: register makes a virtual subclass.
  source: S1
  evidence: "Register subclass as a"

- id: C4
  claim: PEP 3119 proposed ABC support for Python 3000.
  source: S2
  evidence: "This is a proposal to add Abstract Base Class (ABC) support to Python 3000."

## Sources

- [S1] abc — Abstract Base Classes. Python docs (library). https://docs.python.org/3/library/abc.html . License: PSF-2.0. Accessed 2026-11-18.

- [S2] PEP 3119 – Introducing Abstract Base Classes. Python PEPs. https://peps.python.org/pep-3119/ . License: Public-Domain. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs (library), abc — Abstract Base Classes; Python PEPs, PEP 3119 – Introducing Abstract Base Classes. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Public-Domain (https://peps.python.org/pep-0001/). PEP text is placed in the public domain (some also CC0-1.0). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
