Oct-13-2023, 07:35 AM
(Oct-13-2023, 06:57 AM)akbarza Wrote: what is the difference between them?Globally speaking, I would say that
next()
and iter()
are a public interface while __next__()
and __iter__()
are an implementation interface of the iterator protocol.Functionally speaking, there is a difference in that next() and iter() accept a second argument as explained in their documentation.