Why don't we call the for loop what it really is, a foreach loop?

Jerry Hill malaclypse2 at gmail.com
Tue Sep 13 17:17:28 EDT 2016


On Tue, Sep 13, 2016 at 4:57 PM,  <rgrigonis at gmail.com> wrote:
> It would help newbies and prevent confusion.

Are you asking why Guido didn't call it foreach back in 1989, or why
the core developers don't change it now, 27 years later?  I can't
speak for the historical perspective, but I'm sure there's basically
no chance that it will be changed now.  It would be a totally
backwards incompatible change, invalidate every tutorial and bit of
python documentation that's been written over the last three decades,
and break pretty much every python program that works today. In
exchange, you get newbies who are a slightly less confused about for
loops.  That tradeoff isn't worth it.

-- 
Jerry



More information about the Python-list mailing list