class Whatever(object):

    def dosomething(self):
        feature = get_feature('logger')
for i in range(5):
    feature.log('task %s' % i)
if __name__ == '__main__':


    class MyLogger(object):

        def log(sef, line):
            print('Cool', line)
set_feature('logger', MyLogger)
Whatever().dosomething()
Dependency Injection to modules