[Python-ideas] Proto-PEP: Preserving the order of **kwargs in a function.

Eric Snow ericsnowcurrently at gmail.com
Fri Apr 11 00:47:01 CEST 2014


On Thu, Apr 10, 2014 at 4:16 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 10 April 2014 23:04, Barry Warsaw <barry at python.org> wrote:
>> Wouldn't another, much less invasive, much more explicit approach be to not
>> squash subclasses of dict when passed into **args?
>
> Doesn't this fail to support the only significant use case - keyword
> argument syntax for the OrderedDict constructor...?

While perhaps the first one people think of, I wouldn't say it's the
only significant one.  The PEP outlines several that are worth
supporting better.  While these aren't every-day annoyances, neither
is this a proposal for new syntax.  The only real downside is the
performance on functions that have **kwargs in their signature, and
even that has not been proven or disproven as a concern (I'm having
computer problems so I haven't been able to get any concrete data).
The last time I checked, most C OrderedDict operations were about the
same as dict and the worst one took 4x as long.

So just to make this clear, this proposal will only impact performance
for calling a small subset of functions and I anticipate that impact
will be small.

-eric


More information about the Python-ideas mailing list