[Python-Dev] Very Strange Argument Handling Behavior

Guido van Rossum guido at python.org
Sat Apr 17 04:47:05 CEST 2010


On Fri, Apr 16, 2010 at 2:56 PM, Raymond Hettinger
<raymond.hettinger at gmail.com> wrote:
>
>> On Fri, Apr 16, 2010 at 2:11 PM, Raymond Hettinger
>> <raymond.hettinger at gmail.com> wrote:
>>>
>>>>> Guido van Rossum, 16.04.2010 16:33:
>>>>>>
>>>>>> I am fine with
>>>>>> declaring dict({}, **{1:3}) illegal, since after all it is abuse of
>>>>>> the ** mechanism.
>>>
>>> ISTM that making it illegal costs cycles with giving any real benefit.
>>
>> Diasagree. The real benefit is better cross-implementation portability.
>
> Would hate for 100% of users will pay a performance penalty
> when most applications aren't abusing keyword dictionaries
> so they already work cross-platfrom.
>
> Isn't there anyway to make this a one-time check instead
> of a PyLint style validation check running on every invocation
> of a function or method using **kwds?
>
> Or perhaps there can be a switch or flag to enable developers to
> check for non-standard uses of **kwds.  That way, they can clean-up
> their programs but not make the end users pay for the checks every time
> they run an application that has already been cleaned-up.

Please stop worrying.

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list