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

> I simply disagree that Python's closures remain broken, they're simply fixed within the constraints set by previous design decisions.

The fact that I have to distinguish between `global`, `nonlocal` and `default` scope makes them broken. `nonlocal` is a hack.

Saying that it's a result of previous design decisions is a sound technical reason for why `nonlocal` is necessary to make closures work. But as an abstraction, at least, they are broken.

With that, I will concede that they are broken in two different ways between Python 2 and Python 3. This is IMO.



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

Search: