Runtime inspection utilities for Python's typing module, enabling programmatic analysis of type hints.
Typing Inspect is a Python library that provides runtime inspection utilities for the standard `typing` module. It allows developers to programmatically analyze type hints, such as detecting generic types, extracting type arguments, and identifying special constructs like unions and optionals. This is particularly useful for building tools that need to understand or manipulate type information at runtime.
Python developers working on metaprogramming, type checkers, serialization libraries, or any tool that requires runtime analysis of type annotations.
Developers choose Typing Inspect because it offers a dedicated, experimental API for type introspection that isn't fully provided by Python's standard library, enabling more advanced and reliable type-aware tooling without reinventing the wheel.
Runtime inspection utilities for Python typing module
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides functions like is_generic_type and is_union_type to inspect a wide range of typing constructs, filling gaps in Python's standard library for advanced analysis.
Offers a dedicated, experimental API for runtime type introspection, enabling reliable tooling for metaprogramming and type-aware libraries where Python's typing module falls short.
Designed to work with typing version 3.7.4 and later, ensuring compatibility with contemporary Python type hints and features.
Essential for building custom type checkers, serialization libraries, and IDE plugins by allowing programmatic extraction of type origins, parameters, and arguments.
The library is explicitly marked as experimental, meaning the API could change, posing a risk for production code that relies on stable interfaces.
Only supports the latest version of the typing module, making it unsuitable for projects with older dependencies or Python environments.
Functions like get_args with evaluate=True are noted to be time and memory expensive, which could impact performance in intensive runtime introspection scenarios.