A backport of Python 3.10's inspect.get_annotations() function, providing forward-compatible access to object annotations (function arguments, class attributes, etc.) for Python 3.6+. Version 0.1.2 is the latest; no recent releases.
pip install get-annotationsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Replaces inspect.get_annotations() with a backport for older Python versions.
Use 'from get_annotations import get_annotations' only if sys.version_info < (3,10); otherwise use 'inspect.get_annotations'.
Wrap call in try/except TypeError or check if object supports annotations via hasattr() before calling.
Use typing.get_type_hints() if you need resolved annotations.
Use 'from get_annotations import get_annotations'
Call get_annotations(some_function_or_class)
No dependency data recorded yet.