[Python-Dev] 2.5 and beyond (original) (raw)

Andrew Koenig ark at acm.org
Sun Jul 2 02:22:46 CEST 2006


Don't recall what that was, but creating a new scope on each iteration sounds hard to explain in Python.

I don't think it's particularly hard to explain. For example, one way to explain it is to say that

for i in <<stuff>>:
    body

is equivalent to

for <<hiddenvar>> in <<stuff>>:
    local i = <<hiddenvar>>
    body

This explanation doesn't need to rest on recursion.



More information about the Python-Dev mailing list