MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / Strategy

Class Strategy

src/Strategy/Conceptual/main.py:81–98  ·  view source on GitHub ↗

EN: The Strategy interface declares operations common to all supported versions of some algorithm. The Context uses this interface to call the algorithm defined by Concrete Strategies. RU: Интерфейс Стратегии объявляет операции, общие для всех поддерживаемых версий некотор

Source from the content-addressed store, hash-verified

79
80
81class Strategy(ABC):
82 """
83 EN: The Strategy interface declares operations common to all supported
84 versions of some algorithm.
85
86 The Context uses this interface to call the algorithm defined by Concrete
87 Strategies.
88
89 RU: Интерфейс Стратегии объявляет операции, общие для всех поддерживаемых
90 версий некоторого алгоритма.
91
92 Контекст использует этот интерфейс для вызова алгоритма, определённого
93 Конкретными Стратегиями.
94 """
95
96 @abstractmethod
97 def do_algorithm(self, data: List):
98 pass
99
100
101"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected