class A:

    def __init__(self, num, target):
        self.num = num
self.target = target


class B:

    def __init__(self, num):
        self.a = A(num, self)
Passing self into a constructor in python