Original link: Stop Using If-Else Chains: Use the Registry Pattern in Python Instead / KDnuggets.
Cool code. I just prefer the if else construct because it is so simple to read! :-)