What will be the output of this code and can anyone explain how repr method works in OOP?
class Item:
    all = []
    def __init__(self,name,age):
        self.name = name
        self.age = age
        Item.all.append(self)
    def __repr__(self):
        return f"Item('{self.name}','{self.age}')"
m1 = Item('Pranav',18)
m2 = Item('Chris',20)
print(Item.all)
Will __repr__ method automatically get called when the object is created?
The output I got was:
[Item('Pranav','18'), Item('Chris','20')]
Can anyone explain how this is happening?
 
    