<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">Using lambdas doesn't solve the problem. I just kept the example short, but had I used more than one expression in each function, you'd be back to square one. You took advantage of the brevity of the example, but it's not realistic.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">There are lots of language specific features that library authors use, like operator overloading, ABCs etc...</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">Python is a great language, and I always opt for it when it's an option, but I've used it to write front-end code, and it sucks.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace">-- Carl Smith</font></span><br></div></div><div><span style="color:rgb(115,115,115);font-style:italic;line-height:18px"><font size="1" face="monospace, monospace"><a href="mailto:carl.input@gmail.com" target="_blank">carl.input@gmail.com</a></font></span></div></div></div></div></div></div>
<br><div class="gmail_quote">On 12 August 2017 at 00:46, Alberto Berti <span dir="ltr"><<a href="mailto:alberto@metapensiero.it" target="_blank">alberto@metapensiero.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>>>> "Carl" == Carl Smith <<a href="mailto:carl.input@gmail.com">carl.input@gmail.com</a>> writes:<br>
<br>
    Carl> Python is not a good fit for the browser, in part, because of the syntax.<br>
    Carl> JavaScript has issues, but its syntax is better suited to creating GUIs in<br>
    Carl> the browser.<br>
<br>
Just so?<br>
<br>
    Carl> For example, in browsers everything revolves around a single<br>
    Carl> threaded event loop, so you have a lot of callbacks and event<br>
    Carl> handlers,<br>
<br>
You can write applications full of callbacks using libraries like<br>
Twisted or even asyncio and you can build entire applications involving<br>
ajax and such without callbacks as JS got async/await too in ES8<br>
<br>
event handlers are written more or less the same in Pyhton or<br>
Javascript<br>
<br>
    Carl> which makes function expressions really useful, but Python doesn't have<br>
    Carl> expressions that contain blocks, because of significant<br>
    Carl> indentation.<br>
<br>
yes, i agree that the difference between lambda an anonymous function is<br>
very significant on the way you may think to write your code.<br>
<br>
    Carl> As a result, ordinary JS, like this...<br>
<br>
    Carl>     $(function(){ $("spam").click(function(){ alert("spam clicked") }) });<br>
<br>
I don't think you mean this is real JS application code :-)<br>
<br>
    Carl> ...ends up looking like this...<br>
<br>
    Carl>     def on_ready():<br>
    Carl>         def click_handler(): alert("spam clicked")<br>
    Carl>         jQuery("spam").click(click_<wbr>handler)<br>
    Carl>     jQuery(on_ready)<br>
<br>
or just<br>
<br>
   jQuery(lambda: jQuery("spam").click(lambda: alert("spam clicked")))<br>
<br>
<br>
    Carl> JS semantics means JS libraries, which have APIs that assume JS syntax.<br>
    Carl> Python library developers make heavy use of language specific features to<br>
    Carl> define elegant, Pythonic APIs, which is a big part of what makes the<br>
    Carl> language so nice to use.<br>
<br>
language specific features... like?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br></div>