inspect2
Backport of the Python 3.6 inspect module to Python 2.7-3.5
What it is and what it does
inspect2 is a backport of Python 3.6's inspect module to older Python versions (2.7 and 3.2–3.5). It allows developers working on legacy codebases to use the newer inspect API for introspecting functions, classes, methods, and other code objects without upgrading their Python runtime. The module aims to minimize divergence from the standard library source, making future backports easier to maintain.
The package has no runtime dependencies and installs as a pure-Python wheel. However, it has been abandoned since August 2019 and will not receive updates. It is most useful as a temporary compatibility shim for projects still supporting Python 2.7 or early Python 3 versions; for new projects or those targeting modern Python, the standard library inspect module should be used directly.
Use it for:
- Backporting code that uses Python 3.6 inspect features to a Python 2.7 or 3.2–3.5 codebase without rewriting introspection logic.
- Providing a unified inspect API across multiple Python versions in a legacy application that cannot yet upgrade.
- Testing or validating function signatures and metadata in older Python environments during a gradual migration to newer versions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides the Python 3.6 inspect module API on Python 2.7 and 3.2–3.5, allowing code written for newer Python versions to introspect functions, classes, and objects on older runtimes.
No, unless you are maintaining a legacy Python 2.7 or 3.2–3.5 codebase that requires Python 3.6 inspect features and cannot be upgraded. The package is abandoned (last release 2019-08-10) and will not receive security or compatibility updates. For new projects or those on modern Python versions, use the standard library inspect module directly.
Install
inspect2 on PyPI
pip
pip install inspect2uv
uv add inspect2poetry
poetry add inspect2Installing inspect2
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2019-08-10 and the repository shows no recent activity. It is marked Alpha and will not receive updates for bugs or compatibility with modern Python versions.
License in practice
Licensed under the Python Software Foundation License (PSF), a permissive license. You may use, modify, and distribute the package freely, including in commercial projects, provided you retain the license notice.
Quickstart
pip install inspect2
import inspect2
# Use inspect2 functions like the standard inspect module
print(inspect2.signature(some_function))
Designed for Python 2.7 and 3.2–3.5; on Python 3.6+ the standard library inspect module is preferred and should be used instead.
Verify before relying
- Whether inspect2 functions correctly on Python 3.5 and earlier in current environments, given the 2019 last release and lack of maintenance.
- Compatibility with modern Python tooling and test frameworks that may have evolved since 2019.
Package facts
| License | PSF (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,561 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 123,598/month — #11,904 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: inspect2-0.1.2-py2.py3-none-any.whl
Keywords: inspect, inspection, backport
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
funcsigsProvides Python function signature…
permissive · top 5,000 on PyPI
qualnameProvides a `qualname()` function that emulates…
permissive · top 15,000 on PyPI
django-utils-sixProvides a backport of Django 2.2's…
permissive · top 15,000 on PyPI
typing-inspectProvides runtime inspection utilities for…
permissive · top 1,000 on PyPI
typingProvides type hints and annotations for Python…
permissive · top 5,000 on PyPI
importlibProvides importlib.import_module() for Python…
unclear · top 15,000 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
linecache2Provides a backport of Python's linecache…
permissive · top 5,000 on PyPI
backports_abcProvides backports of abstract base classes…
permissive · top 15,000 on PyPI
fissixfissix is a backport of Python's lib2to3…
permissive · top 15,000 on PyPI