[Python-Dev] Very Strange Argument Handling Behavior

Guido van Rossum guido at python.org
Fri Apr 16 18:14:22 CEST 2010


On Fri, Apr 16, 2010 at 8:35 AM, Stefan Behnel <stefan_ml at behnel.de> 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.
>
> It's a bit like letting keys like 'not-an-identifier' pass through, though,
> isn't it?

Not really. It's hard to imagine(*) an implementation that naturally
can represent strings that look like identifiers but not other strings
-- typically, "identifier-ness" must be explicitly checked. But it's
easy to imagine an implementation that only allows strings and not
other values.

___
(*) I didn't say impossible. I don't really care about any
counter-examples you may come up with -- in practice they don't
matter. But the type *does* matter in practice.

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


More information about the Python-Dev mailing list