DeferredImportIndicator
(class from pyomo.common.dependencies)
- class pyomo.common.dependencies.DeferredImportIndicator(name, error_message, catch_exceptions, minimum_version, original_globals, callback, importer, deferred_submodules)[source]
Bases:
_DeferredImportIndicatorBasePlaceholder indicating if an import was successful.
This object serves as a placeholder for the Boolean indicator if a deferred module import was successful. Casting this instance to bool will cause the import to be attempted. The actual import logic is here and not in the
DeferredImportModuleto reduce the number of attributes on theDeferredImportModule.DeferredImportIndicatorsupports limited logical expressions using the&(and) and|(or) binary operators. Creating these expressions does not trigger the import of the correspondingDeferredImportModuleinstances, although casting the resulting expression tobool()will trigger any relevant imports.- __init__(name, error_message, catch_exceptions, minimum_version, original_globals, callback, importer, deferred_submodules)[source]
Methods
__init__(name, error_message, ...)replace_self_in_globals(_globals)resolve()Member Documentation