--- id: typing-inspect version: "0.9.0" license: MIT license_treatment: permissive maintenance: aging --- # typing-inspect — Runtime inspection utilities for typing module. License: permissive · Maintenance: aging · Popularity: top 1,000 on PyPI ## Install pip install typing-inspect uv add typing-inspect poetry add typing-inspect ## Description Typing Inspect ============== [![Build Status](https://travis-ci.org/ilevkivskyi/typing_inspect.svg)](https://travis-ci.org/ilevkivskyi/typing_inspect) The ``typing_inspect`` module defines experimental API for runtime inspection of types defined in the Python standard ``typing`` module. Works with ``typing`` version ``3.7.4`` and later. Example usage: ```python from typing import Generic, TypeVar, Iterable, Mapping, Union from typing_inspect import is_generic_type T = TypeVar('T') class MyCollection(Generic[T]): content: T assert is_generic_type(Mapping) assert is_generic_type(Iterable[int]) assert is_generic_type(MyCollection[T]) assert not is_generic_type(int) assert not is_generic_type(Union[int, T]) ``` **Note**: The API is still experimental, if you have ideas/suggestions please open an issue on [tracker](https://github.com/ilevkivskyi/typing_inspect/issues). Currently ``typing_inspect`` only supports latest version of ``typing``. This limitation may be lifted if such requests will appear frequently. Currently provided functions (see functions docstrings for examples of usage): * ``is_generic_type(tp)``: Test if ``tp`` is a generic type. This includes... ## AI interpretation — verify before relying Provides runtime inspection utilities for Python's typing module, allowing you to query and decompose type annotations at runtime—testing whether types are generic, callable, unions, literals, and extracting their origins, arguments, and parameters. Verdict: A stable, low-friction utility for runtime type introspection with no known vulnerabilities and permissive MIT licensing. Best suited for projects that need to inspect or decompose type annotations at runtime. Maintenance is aging (last release mid-2023) but the repository remains active; use it where its specific functionality is needed. [View on SkillFed](https://skillfed.io/packages/typing-inspect) · [View on PyPI](https://pypi.org/project/typing-inspect/)