design-patterns/behavioral/strategy/strategy.py
Ruidy 03cb570b65
Strategy (#22)
* add documentation

* add code example
2020-10-09 12:01:22 +02:00

15 lines
347 B
Python

from abc import ABC, abstractmethod
class Strategy(ABC):
"""
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.
"""
@abstractmethod
def do_algorithm(self, data: list):
pass