class A:
def __new__(self):
self.__init__(self)
print("A's __new__() invoked") #print if called
def __init__(self):
print("A's __init__() invoked") #print if called
class B(A):
def __new__(self):
print("B's __new__() invoked") #print if called
def __init__(self):
print("B's __init__() invoked") #print if called
def main():
b = B() #create an object of B
a = A() #create an object of A
main()
why the result is "B's new() invoked A's init() invoked A's new() invoked?I wonder why B's init method is not called.