Iteration Protocol

How the code worked without iter and __next__being called in class yrange…

Please post the specific code as well or share a link.
It is difficult to answer problem without any reference.