cached_import
Imports a specified class from a module, utilizing the system cache to retrieve the module if it is already fully initialized or performing a fresh import if necessary.
def cached_import(
module_path: string,
class_name: string
) - > Any
Dynamically imports a module and retrieves a specific attribute from it, utilizing the system cache to avoid redundant initialization.
Parameters
| Name | Type | Description |
|---|---|---|
| module_path | string | The full dot-notation path of the Python module to import. |
| class_name | string | The name of the class or attribute to retrieve from the imported module. |
Returns
| Type | Description |
|---|---|
Any | The class or attribute retrieved from the specified module. |