<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-05-23 6:32 GMT+09:00 Kirill Balunov <span dir="ltr"><<a href="mailto:kirillbalunov@gmail.com" target="_blank">kirillbalunov@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Just one more variation on "assignment exression" syntax to make the list more complete :) Sorry, if something similar has already been suggested. The idea is to use function's call-like syntax in the from: `<font face="monospace, monospace">this( name = expr )</font>`. I'm not sure that such idea will find its supporters and whether it is possible to implement it in a general way, but nevertheless. Below is a half- and slow-working prototype and some silly examples just for the sake of feeling the idea:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><div><font face="monospace, monospace">import sys</font></div></div><div><div><font face="monospace, monospace">import ctypes</font></div></div><div><div><font face="monospace, monospace"><br></font></div></div><div><div><font face="monospace, monospace">def this(**assign):</font></div></div><div><div><font face="monospace, monospace">    assert len(assign) == 1</font></div></div><div><div><font face="monospace, monospace">    [(name, value)] = assign.items()</font></div></div><div><div><font face="monospace, monospace">    frame = sys._getframe(1)</font></div></div><div><div><font face="monospace, monospace">    frame.f_locals[name] = value</font></div></div><div><div><font face="monospace, monospace">    ctypes.pythonapi.PyFrame_<wbr>LocalsToFast(ctypes.py_object(<wbr>frame),</font></div></div><div><div><font face="monospace, monospace">                                          ctypes.c_int(0))</font></div></div><div><div><font face="monospace, monospace">    return value</font></div></div></blockquote></div></blockquote><div></div><div>FYI, I found a package [*] which binds a value by function keyword (I'm not the author). Note that the package writes a value in the global (or raise an error if the name already exists in local) unlike your idea.<br></div><div><br></div><div>[*] <a href="https://pypi.org/project/let3/">https://pypi.org/project/let3/</a><br></div><div><br></div><div>--<br></div><div>Masayuki<br></div></div></div></div>