3 ms·
> A very common pattern in Scheme and JavaScript (...) is to use closures to encapsulate state. Thanks to Python's scoping model, this is at best a pain and cer
by Xion 14y ago
> A very common pattern in Scheme and JavaScript (...) is to use closures to encapsulate state. Thanks to Python's scoping model, this is at best a pain and certainly unnatural.
It is also unnecessary. Python has normal classes, so you can contain your state within objects rather than stackframes.