Structural Decorators¶
Singleton pattern enforcement.
SingletonClass
¶
Enforces singleton behavior by wrapping the class in a custom subclass.
Prevents the user-defined class from defining its own __new__, which would
conflict with the singleton logic.
| RETURNS | DESCRIPTION |
|---|---|
type
|
A singleton-enforcing subclass of the original |