Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While true, that is not really the issue. The issue is which lexical scope the loop iterator is defined in. In python, it is apparently like this:

    i = 0
    increment i
    <do loop body with i>
It could have been:

    i = 0
    increment 1
      create new environment
      bind i here
      <do loop body>
In the second case, each loop body would have its own "i". In the first case, they all share the same "i".


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: