grocery_stocker wrote:
How come when I call some_func().next(), the counter doesn't get
incremented?

Because you're creating a new instance each time you call it. Each new instance starts with 0.

But when I call iterator.next(), it does.

That's because you're iterating over a single object, so successive calls to .next give you success iteration values like you intended.

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
 San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
  We must all hang together, or, most assuredly, we will all hang
   separately. -- John Hancock
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to