Re:Go: Redefining For Loop Variable Semantics
by Semaphor on Tuesday October 11, 2022 @09:21AM
(#33163035)
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?
[ Parent
| on HN ]
Re:Go: Redefining For Loop Variable Semantics
by ketzu on Tuesday October 11, 2022 @09:43AM
(#33163261)
Copy pasting OPs code to pycharm: No warning.
Re:Go: Redefining For Loop Variable Semantics
by Semaphor on Tuesday October 11, 2022 @09:47AM
(#33163309)
Probably worthy of a YouTrack report ;)
Re:Go: Redefining For Loop Variable Semantics
by jstx1 on Tuesday October 11, 2022 @10:46AM
(#33163970)
Pylint catches it - https://pylint.pycqa.org/en/latest/user_guide/messages/warni...