backports_abc
A backport of recent additions to the 'collections.abc' module.
What it is and what it does
backports_abc fills a gap for developers maintaining code that must run on Python 2.x or Python 3.2, where abstract base classes like Coroutine, Generator, and Awaitable did not yet exist in the standard library. Starting in Python 3.3, these classes moved into collections.abc as part of the standard library. This package provides those classes as a fallback import for older interpreters, and includes a patch() function that can inject them into the collections or collections.abc module namespace to make them available through the standard import path.
The package has no runtime dependencies and installs with low friction. However, it has been abandoned since 2016 and is only relevant for legacy Python 2 or Python 3.2 codebases. Modern Python versions render it unnecessary.
Use it for:
- Maintaining a library that must support Python 2.7 while using Coroutine or Generator type hints.
- Patching collections.abc in Python 3.2 environments to provide missing abstract base classes.
- Conditional imports in compatibility layers that need to work across Python 2, 3.2, and 3.3+.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides backports of abstract base classes (Generator, Coroutine, Awaitable) and related inspect functions from collections.abc for older Python versions that lack them.
No, unless you are actively maintaining Python 2.x or Python 3.2 codebases. For any modern Python project (3.3+), these classes are built-in and this package is unnecessary. The package is abandoned and will not receive updates or security patches. If you do need it for legacy support, installation is safe and frictionless, but consider whether the legacy Python version itself is still worth supporting.
Install
backports-abc on PyPI
pip
pip install backports-abcuv
uv add backports-abcpoetry
poetry add backports-abcInstalling backports_abc
Before you install
Installation is frictionless with no runtime dependencies. However, the package is abandoned—last commit was 2022-01-29 and no releases since 2016-11-12. It remains stable for its narrow purpose but will not receive updates.
License in practice
Licensed under the Python Software Foundation License (permissive). No licensing restrictions on use or redistribution.
Quickstart
pip install backports_abc
import backports_abc
backports_abc.patch()
from collections.abc import Coroutine, Generator
Primarily useful for Python 2.x and Python 3.2; modern Python versions (3.3+) have these ABCs built-in, making this package unnecessary for current codebases.
Verify before relying
- Whether this package is still necessary given that Python 2 reached end-of-life in 2020 and Python 3.2 is no longer supported.
- Current real-world usage patterns and whether new projects still depend on it.
Package facts
| License | UNKNOWN (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,562 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 576,451/month — #5,930 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: backports_abc-0.5-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
exceptiongroupProvides exception group classes and utilities…
permissive · top 1,000 on PyPI
pathlib-abcProvides abstract base classes for implementing…
permissive · top 1,000 on PyPI
inspect2Provides the Python 3.6 inspect module API on…
permissive · top 15,000 on PyPI
traceback2Provides a backport of Python's traceback…
permissive · top 5,000 on PyPI
backports.asyncio.runnerProvides the Python 3.11 asyncio.Runner context…
permissive · top 1,000 on PyPI
linecache2Provides a backport of Python's linecache…
permissive · top 5,000 on PyPI
backports.functools-lru-cacheProvides the lru_cache decorator from Python…
permissive · top 5,000 on PyPI
contextlib2contextlib2 backports the Python standard…
permissive · top 5,000 on PyPI
backports.sslProvides the Python 3.4 ssl module API on older…
permissive · top 15,000 on PyPI
python-interfaceDeclares interfaces and statically asserts that…
permissive · top 15,000 on PyPI