hbutils.reflection
Reflection utility package for Python introspection and runtime manipulation.
This package aggregates a set of reflection-related utilities from multiple
submodules into a single import point. The public API is re-exported via
wildcard imports, allowing users to access functions and classes directly from
hbutils.reflection.
The package exposes functionality from these modules:
hbutils.reflection.clazz- Class inspection and manipulation helpershbutils.reflection.context- Context management utilitieshbutils.reflection.exception- Exception handling helpershbutils.reflection.func- Function inspection and invocation helpershbutils.reflection.imports- Import-related utilitieshbutils.reflection.iter- Iterator utilitieshbutils.reflection.module- Module inspection utilities
Example:
>>> from hbutils.reflection import context, dynamic_call, mount_pythonpath
>>> # Use context management
>>> with context().vars(debug=True):
... print(context().get('debug'))
True
>>> # Use dynamic function calling
>>> def func(a, b=2):
... return a + b
>>> dynamic_call(func, {'a': 1, 'b': 3, 'c': 4}) # 'c' is ignored
4
Note
This package module re-exports symbols from its submodules, so the exact set of available utilities depends on the implementations of those modules.
- hbutils.reflection.clazz
- hbutils.reflection.context
- hbutils.reflection.exception
- hbutils.reflection.func
- hbutils.reflection.imports
- hbutils.reflection.iter
- hbutils.reflection.module