I'm trying to understand the difference between iterator and generator. I read that "Every generator is an iterator, but not vice versa."
Could someone give an example of an object that IS an iterator, but IS NOT a generator?
I mean, if an object has method next (which is the definition of an iterator), we can also call it a generator, can't we?
UPD: for those who say that generator must have yield - not always. (i**2 for i in range(1,5)) doesn't have yield and is also a generator.
For those who say that iter([1,2,3]) is not a generator - why? Which definition of a generator it contradicts and where?