skillfed

inspect2

Backport of the Python 3.6 inspect module to Python 2.7-3.5

inspect2 v0.1.2 123.6K downloads/30d#11,904 on PyPI3
Permissive license PSF Abandoned released

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 inspect2

uv

uv add inspect2

poetry

poetry add inspect2

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Python Software Foundation LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Software Development

Tags

inspect module backportpython 2.7 inspect compatibilityfunction introspection older pythoninspect api python 3.6 backportreflection utilities python 2code inspection compatibility layer
backportlegacy-python

More Software Development packages