Closed matthew-d-jones closed 7 years ago
I'm not too keen on interface classes in python and at the time @markbasham agreed. I believe we made a conscious decision for duck typing then. This also ups the LOC for the "core" source by over 30% for a slightly nicer exception if you make an obvious mistake. I like simple and short is a friend of simple.
This adds an
IRecipe
class, a virtual class which acts as documentation for the interface which arecipe
should have. It also allows testing that arecipe
implements this interface by usingisinstance(potentially_a_recipe, IRecipe)
. Thanks to__subclasshook__()
this is possible withoutpotentially_a_recipe
having to explicitly subclassIRecipe
.This is a suggested design change; don't merge it if you don't like it.