class MyClass1(Parent):

    def __init__(self):
        self.foo = 1


class MyClass2(Parent):

    def __init__(self):
        self.foo = 2
bar = Parent(1)
print(bar.foo)
baz = Parent(2)
print(bar.foo)
How to dynamically compose and access class attributes in Python?