Using the Command Pattern to Write More Testable Python

Often times, when writing Python, I run into a situation that requires me to write a simple validation function. def check_validity(item): return item.value_to_check > 0def check_validity(item): return item.value_to_check > 0 This function is easy to test, and it’s clear what it’s supposed to be doing. But as so often happens, I may need to validate […]