skillfed

backports_abc

A backport of recent additions to the 'collections.abc' module.

backports-abc v0.5 576.5K downloads/30d#5,930 on PyPI7
Permissive license UNKNOWN Abandoned released

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-abc

uv

uv add backports-abc

poetry

poetry add backports-abc

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3

Tags

collections.abc backportcoroutine generator abcpython 2 3.2 compatibilityabstract base classes backportawaitable coroutine inspect
python-2-compatlegacy-support

More Software Development packages