On Tuesday, February 2, 2016, Richard Purdie <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Right now, if you have some python code like:<br>
<br>
X = "a"<br>
<br>
def somefunction(d):<br>
d.setVar("X", "b")<br>
d.setVar("Y", "${X}")<br>
<br>
then any sane person would expect that Y = "b" at the end of the<br>
function. This is not the case, Y = "a".<br>
<br>
This is due to the python function being expanded before execution, the<br>
executed code would read d.setVar("Y", "a"). This understandably<br>
confuses people, it also makes it near impossible to write ${} in a<br>
python function without unintended things happening.<br>
<br>
I think there is general agreement we should fix this and standardise<br>
on non-expansion of python functions. We already don't expand anonymous<br>
python (mostly).<br>
<br>
I've checked OE-Core with buildhistory before and after this change and<br>
there were a small number of issues this exposed which I've sent<br>
patches for.<br>
<br>
I propose we default to not expanding python code and then deal with<br>
any consequences from that if/as/where identified. This will improve<br>
new user understanding and usability of the system, it also allows<br>
several long standing weird expansion issues to be fixed.<br>
<br>
Signed-off-by: Richard Purdie <<a href="javascript:;" onclick="_e(event, 'cvml', 'richard.purdie@linuxfoundation.org')">richard.purdie@linuxfoundation.org</a>><br></blockquote><div><br></div><div>I absolutely support this. It should reduce confusion with no loss of functionality.</div><div><br></div><div>Acked-by: Christopher Larson <<a href="mailto:kergoth@gmail.com">kergoth@gmail.com</a>></div><br><br>-- <br><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div><br>