def __call__(*args, **kw):
    """
        __call__ will happen when an instance of the class (NOT metaclass)
        is instantiated. For example, We can add instance methods here and they will
        be added to the instance of our class and NOT as a class method
        (aka: a method applied to our instance of object).
        Or, if this metaclass is used as a factory, we can return a whole different
        classes' instance
        """
return 'hello world!'


class FactorWorker(object):
    pass
Реализация шаблона проектирования factory с использованием метаклассов в python