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

__init__()[source]

Initializes the placeholder with the name of the extension module.

__getattr__()[source]

Intercepts attribute access attempts, raising a RuntimeError.

__setattr__()[source]

Intercepts attribute modification attempts, allowing only the _name attribute to be set.

Methods

__init__

Initializes the ExtensionModulePlaceholder with a specified name.

__init__(name: str) None[source]

Initializes the ExtensionModulePlaceholder with a specified name.

Parameters:

name (str) – The name of the extension module this placeholder represents.