On Wed, May 15, 2019 at 12:46 AM Anders Hovmöller <bo...@killingar.net>
wrote:

>
>
> > On 15 May 2019, at 07:51, Jonathan Goble <jcgob...@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.
>

It was actually a decision of the Python steering council, of which Guido
is a member and so am I.


>
> 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.


There's actually more to it than that (it actually resolves various bugs we
had in the stdlib that have nothing to do with C extension modules). The
details can be found in the PEP.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to