class Parent(object):

    def bar(self):
        print('bar')


class MetaFoo(type):

    def __new__(cls, name, bases, dict):
        return type(name, (Parent,) + bases, dict)


class Foo(object, metaclass=MetaFoo):
    pass
How to add method using metaclass