3 ms·
No, I'm saying that the OP's code isn't actually modifying a local variable, because it never assigns to an element of the f_locals dictionary.
by teraflop 9y ago
No, I'm saying that the OP's code isn't actually modifying a local variable, because it never assigns to an element of the f_locals dictionary.
- eesmith 9y agoTo further clarify, it modifies the value of an object referenced by a local variable.
- arghwhat 9y agoYou were referring to CPython implementation details, which do not apply to Jython, IronPython, PyPy, and many more. Alternative Python implementations do not follow all CPython implementation details. In other words, if this is not part of the Python specification, it might work on other Python implementations even if it does not work on CPython.
- dr_zoidberg 9y ago> ...Jython... Which is Java with Python syntax...
- arghwhat 9y agoNo. Jython is a full implementation of Python in Java. Last I collided with it, it was terribly slow, but that is not the point here. Some of these alternative implementations are very interesting. PyPy is JIT'ed, and insanely fast compared to CPython. IronPython, IIRC, has no GIL.