Hacker News new | ask | show | jobs
by o11c 999 days ago
It's actually worse in Python since there's no support for variable lifetimes within a function, so the `v2` workaround is still broken. (the default-argument workaround "works" but is scary)

This makes it clear: the underlying problem is NOT about for loops - it's closures that are broken.

1 comments

It's not broken, it's a different design. Maybe worse in a lot of cases, but it's not broken. It's working as intended.
You could say the design is broken, but the implementation is working as intended by the design.