Iterators (was: Re: [Tutor] text module)
Erik Price
erikprice@mac.com
Sun, 1 Sep 2002 10:39:57 -0400
On Saturday, August 31, 2002, at 08:56 PM, Ibraheem Umaru-Mohammed
wrote:
> A good article on iterators and generators is:
>
> ,---- [ url ]
> |
> http://www-106.ibm.com/developerworks/library/l-
> pycon.html?t=gr,lnxw10=PyIntro
> `----
Thanks Ibz, I will read that article.
> I haven't played much with iterators myself, nor simple generators,
> but the code
> below might help, as it is an example that uses both the __iter__()
> and next() methods
> required of user-defined classes that adhere to the iterator protocol.
"iterator protocol" makes me wonder if iterators are found in other
programming languages other than Python. Obviously it wouldn't use the
double-underscore convention for the method to be subclassed, but is
this something that's found in C++, Java, or Obj-C (etc)?
Thank you,
Erik
--
Erik Price
email: erikprice@mac.com
jabber: erikprice@jabber.org