hbutils.design
Design pattern utilities for the hbutils.design package.
This package provides lightweight, Pythonic implementations of several classic
design patterns. It acts as a convenience entry point that re-exports all public
APIs from its submodules, allowing consumers to import from hbutils.design
directly.
The package includes the following public components:
FinalMeta- Metaclass that prevents class inheritance (final class)SingletonMeta- Metaclass implementing the singleton patternDecorator helpers from
hbutils.design.decoratorObserver pattern utilities from
hbutils.design.observer
Note
This module is an aggregation layer that imports and exposes public objects from its submodules. Refer to each submodule for detailed behavior and API specifics.
Example:
>>> from hbutils.design import SingletonMeta
>>> class MyClass(metaclass=SingletonMeta):
... pass
>>> instance1 = MyClass()
>>> instance2 = MyClass()
>>> instance1 is instance2
True