bitorch_engine.utils.safe_import.ExtensionModulePlaceholder
- class bitorch_engine.utils.safe_import.ExtensionModulePlaceholder(name: str)[source]
A placeholder class for extension modules.
This class serves as a placeholder for dynamically loaded extension modules. It is designed to intercept attribute access and modifications, raising a runtime error if any operation other than setting the initial name is attempted. This behavior ensures that any misuse of the placeholder, such as accessing or modifying attributes that are not supposed to exist in the placeholder state, is promptly identified during development.
- _name
The name of the extension module this placeholder represents.
- Type:
str
- __setattr__()[source]
Intercepts attribute modification attempts, allowing only the _name attribute to be set.
Methods
Initializes the ExtensionModulePlaceholder with a specified name.