uinspect
raw JSON → 0.0.5 verified Mon Apr 27 auth: no python
Ultra-fast inspect functions for Python, providing drop-in replacements for standard library inspect functions with significantly improved performance. Current version 0.0.5 is in early development, with a focus on speed. Release cadence is irregular.
pip install uinspect Common errors
error AttributeError: module 'uinspect' has no attribute 'getsource' ↓
cause Typo or version mismatch. The function may have been renamed or not yet implemented.
fix
Check the version and available attributes via dir(uinspect). Use 'from uinspect import getsource' if available.
error ImportError: cannot import name 'getsourcelines' from 'uinspect' ↓
cause uinspect may not implement all standard inspect functions. This function might be missing.
fix
Use standard inspect for that specific function: from inspect import getsourcelines
Warnings
gotcha uinspect may not support all objects that the standard inspect module does. Test thoroughly in your use case. ↓
fix Fall back to standard inspect for unsupported objects.
gotcha The package is in early development (v0.0.5). API changes are likely. ↓
fix Pin the version with constraints like uinspect>=0.0.5,<0.1.0
deprecated No deprecations reported yet, but unstable API may deprecate functions without notice. ↓
fix Monitor GitHub releases and changelog.
Imports
- inspect wrong
import uinspect as inspectcorrectimport uinspect - getsource
from uinspect import getsource
Quickstart
import uinspect
import math
source = uinspect.getsource(math.sqrt)
print(source)