Domen Jurkovič added the comment:
Are there any workarounds - how can we use exec() and on-the-fly created
variables?
Also, why 'locals()['bar']' is seen by the interpretter, but not ony 'bar'?
--
___
Python tracker
<https://bugs.python.
Domen Jurkovič added the comment:
Seems like I don't know how to write a code here.
Anyway, issue created on stack overflow can be found on:
https://stackoverflow.com/questions/55239875/python-exec-function-broken-in-versions-above-2-7-error-name-not-defined/5524?noredirect=1
New submission from Domen Jurkovič :
I've reported a stack overflow question and no reasonable explation was
offered. Here is what I've discovered:
.. code-block:: python
def func():
varName = 'bar'
varValue = 42
localVarToEvaluate = varName + ' = varValue