the iter dunder is used to return an iterator of the given object right? what is being returned by it at 6:22 in this video? is it the class object or the class itself? it should be class bcz thats what the iterable is in this case but “return self” means it is returning the object instead
__iter__ dunder doubt
Hey @devchopra999_11c6416ab7f09bbf,
Returning self from a method simply means that the method returns a reference to the instance object on which it was called so object has been returned as with the object we can use class methods and the class is having both iterable as well as iterator.
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.