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

If I do the same with for instead of foreach in C#, my IDE gives me a warning: "Captured variable is modified in the outer scope". Isn’t that the case for Python?


Copy pasting OPs code to pycharm: No warning.



Probably worthy of a YouTrack report ;)


I don't think it is a good practice to capture it in lint tooling, instead of by the language itself.


It’s what linters are great at, catch things that work the way you don’t expect.




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

Search: