who uses Python or Ruby, and for what?

Bob Alexander balexander at rsv.ricoh.com
Tue May 1 15:18:37 EDT 2001


>
> In 2.2 you should be able to do:
>
>     for line in file:
>         ...
>
> to do the same thing.  Iterators are cool.
>

Yes -- I'm looking forward to Python iterators, too.

Since this came up in a Ruby context, I should point out that in Ruby you can write:

  for line in file
     ...
  end

It seems that Python is playing catch-up in this area (Java, Ruby and some other language environments have had iterators since their inceptions), but better late than never! The Python flavor of
iterator is pretty nice.

Bob





More information about the Python-list mailing list