79654750

Date: 2025-06-05 15:25:03
Score: 2
Natty:
Report link

You make an object of class1 and inside class there is a function called method1 so when you write self.method1 python remembers which object it belongs to so you put the function into global list but it is also linked to obj1 then you make obj of class2 and calls it runs global_list[0]() and pulls out obj1 from list.The key idea is when you do self method python stores fun and obj together it is called bound method so even if call later it knows which obj self to use that's why print class1

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Sneha Chatwani