tux.utils.protocols
¶
Defines structural type hints (Protocols) for dependency injection.
This module contains Protocol classes that define the structure of objects required by different parts of the application. By using these protocols for type hinting instead of concrete classes (like Tux
), we can achieve loose coupling between components.
This approach, known as structural subtyping or static duck typing, allows any object that has the required attributes and methods to be used, breaking circular import dependencies and making the codebase more modular and easier to test.
Classes:
Name | Description |
---|---|
BotProtocol | A protocol for the bot instance to provide necessary attributes. |