[Python-ideas] reduce(func, seq, initial=0)

Nick Coghlan ncoghlan at gmail.com
Fri Oct 10 16:05:19 CEST 2014


On 10 Oct 2014 21:07, "Florian Bruhin" <me at the-compiler.org> wrote:
>
> FWIW, I'd also really like to see keyword arguments for these
> builtins. I always have to keep myself from doing things like
>
>     "foo bar    baz".split(count=1)
>
> But as said, I suspect there is *some* reason this is not possible.

The technical reason is that many older CPython functions written in C use
PyArg_ParseTuple, which only supports positional arguments.

When there's a concrete readability gain from adding keyword argument
support to a particular function, patches will often be accepted.

Switching to argument clinic also offers improved introspection support, so
that can be a good way to pursue the enhancement.

Regards,
Nick.


>
> Florian
>
> --
> http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
>              GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
>          I love long mails! | http://email.is-not-s.ms/
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141011/992d257d/attachment.html>


More information about the Python-ideas mailing list