On 15 May 2019, at 07:51, Jonathan Goble <jcgoble3@gmail.com> wrote:
That's not a realistic goal; there are some use cases, including in CPython builtins, that cannot be accomplished without positional-only arguments. For example, the current behavior of the `dict` constructor is to accept both certain iterables as a positional-only argument and/or keyword arguments from which a dict can be created. If the iterable argument was not positional-only, then it would be forced to consume a keyword (even if the caller passes it as a positional argument), meaning that that keyword could never be included in **kwargs and could not become a dict key via keyword arguments.
You lost me. How is this not handled by *args and **kwargs? I think it is. "Positional only" isn't needed in this case.
Additionally, PEP 570 [1], which will add syntax for positional-only parameters in Python functions, was accepted by Guido last month.
I know and in my opinion it's a big mistake. It adapts python to a misfeatures of C extension code instead of making the C extentions play nice end behave like python. But obviously it's too late now. / Anders