Strategy design pattern in Python
Loosely coupled algorithm selection
Strategy pattern is a behavioural design pattern. It allows an object to choose between different strategies in a structured way.
A strategy might be an algorithm — for example, your code might need to apply various search algorithms to a data set. You might need to be able to search a list of words for an exact match, or a matching starting…