2 ms·
Run my examples, they work! Python absolutely has real closures...
by dilap 7y ago
Run my examples, they work! Python absolutely has real closures...
- joshuamorton 7y agoYes your digression example works, but it works equally well without a mutable ref. You need to mutate the thing in the callback (and to have the callback actually close over the ref) to require mutable ref semantics. And yes, python closures don't capture environemtnal vars like rusts do. If you need them to capture env vars, you have to do what I did in the example.
- dilap 7y agoI think our understandings are too far apart to converge in a HN thread. Nevertheless, it has been a pleasure!