[Python-ideas] Fwd: Keyword only argument on function call

Anders Hovmöller boxed at killingar.net
Wed Sep 26 05:12:35 EDT 2018

> I saw now that I missed the biggest problem with your proposal: yet again you deliberately throw away errors. I'm talking about making Python code _less_ error prone, while you seem to want to make it _more_.
> Beyond the belligerent tone, is there an actual POINT here? 

Yes, there is a point: you keep insisting that I shut up about my ideas and you motivate it by giving first totally broken code, then error prone and slow code and then you are upset that I point out these facts. I think it's a bit much when you complain about the tone after all that. Especially after you wrote "If someone steps out of line of being polite and professional, just ignore it" the 9th of September in this very thread.

> It's the middle of the night and I'm on my tablet.

Maybe you could just reply later?

> I'm not sure what sort of error, or in what circumstance, my toy code "throws away" errors. Actually saying so rather than playing a coy guessing game would be helpful.

You explicitly wrote your code so that it tries to pass a local variable "d" that does not exist and the function does not take, and it doesn't crash on that. I guess you forgot? You've done it several times now and I've already pointed this out.

> So for CPython 3.6 it's 2.587355/0.003079 = 840x times slower
> and pypy: 1.177555/0.002565 =  460x slower
> Yes, for functions whose entire body consists of `pass`, adding pretty much any cost to unpacking the arguments will show down the operation a lot.

If you add sleep(0.001) it's still a factor 1.3! This is NOT a trivial overhead. 

> Changing the basic syntax of Python to optimize NOOPs really is a non-starter.

This is not a belligerent tone you think?

> In general, changing syntax at all to avoid something easily accomplished with existing forms is—and should be—a very high barrier to cross.

Sure. I'm not arguing that it should be a low barrier, I'm arguing that it's worth it. And I'm trying to discuss alternatives.

> I haven't used macropy. I should play with it. I'm guessing it could be used to create a zero-cost `use()` that had exactly the same API as my toy `use()` function. If so, you could starting using and publishing a toy version today and provide the optimized version as an alternative also.

Let me quote my mail from yesterday:

"3. I have made a sort-of implementation with MacroPy: https://github.com/boxed/macro-kwargs/blob/master/test.py I think this is a dead end, but it was easy to implement and fun to try!"

Let me also clarify another point: I wanted to open up the discussion to people who are interested in the general problem and just discuss some ideas. I am not at this point trying to get a PEP through. If that was my agenda, I would have already submitted the PEP. I have not.

/ Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180926/300a4dea/attachment-0001.html>

More information about the Python-ideas mailing list