On Sun, 27 Sep 2020 at 06:27, Steven D'Aprano <st...@pearwood.info> wrote: > As far as speed and complexity goes, I do not understand the C > implementation well enough to categorically dismiss your claims, but > from everything I have seen, neither is true: this should not have any > significant slowdown, and the increase in complexity should be quite > small.
If my understanding of the C part is correct, this will have practically zero impact on speed. The compiler will (should) be able to create BINARY_SUBSCR opcodes when it sees an invocation without keyword arguments. It will use a new opcode BINARY_SUBSCR_KW when there's a keyword argument. The only loss in performance is that the C handler for the old variant will likely end up calling the new handler with a kwarg set to NULL, so the total cost is one routine call. But I am not an expert in the C interpreter internals, so I might be wrong. -- Kind regards, Stefano Borini _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PSLXFMOLVHIZIO6U2ENYR3XQS746FEBG/ Code of Conduct: http://python.org/psf/codeofconduct/