About the __iter__() actually does?

Can you please thoroughly explain what iter() magic function actually does…when we do for i in x: where x is an object of class X … and class X is an iterable class …
when actually the iter() function gets called? when we are doing return self or return something else then what’s actually happening??? are all the iterated values are being returned itself to the object as an attribute of the object created???
I hope I make sense…

I guess this doubt is resolved now bihan ???

You can mark this as resolved.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.