Last active
January 2, 2016 12:39
-
-
Save binarymatt/8305119 to your computer and use it in GitHub Desktop.
factory method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .base import AbstractTariff | |
from .us import USTariff | |
from .ca import CATariff | |
def factory(name): | |
mod = sys.modules[__name__] | |
classname = '{}Tariff'.format(name) | |
return getattr(mod, classname, None) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment