Python indeed doesn't have an #each method to iterate over a container
class and pass the elements into a block as is the case with Ruby. I
think this is because Ruby borrowed from Smalltalk with the do, block,
each, etc. aspects of the language. And Python did not.

There is a next( ) method in Python that will advance to the next
element of a container class. Here's a reference -->
http://docs.python.org/lib/typeiter.html. From there you could _sort
of_ create your own block using Python lambdas to mimic things to a
point...

bitdoger2 / yahoo.com wrote:
> newbie asks: is it true that python does NOT support containers simply
> like ruby does?
> ie.
> a=[]<<  an array container
> a<<[0,1,2]
> a<<{"me"=>"i think","you"=>"you think"}
> and then use .each iterater to process this container....
> howachen / gmail.com wrote:
> > Besides ROR, can you give me a reason why perfer ruby instead of
> > python?
> >
> > seems to many users, they are very similar in nature...
> >
> > such as
> >
> > 1. non C or Java style syntax
> > 2. focus on codes readability, not like Perl
> > 3. ..