On Fri, Apr 16, 2010 at 2:11 PM, Raymond Hettinger <raymond.hettin...@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. > It is reasonably common to accept **kwds and then pass it down > to another function. Do we want to validate the keys of every > kwds dict on every call? Why do we even care? > > If I'm understanding the proposal correctly, it means that > every existing application using **kwds will pay a price, either > by breaking (because it uses non-string keys) or by running > slower (so that every call can be checked to make sure it > didn't use string keys). It already does this for Python functions. So there is no cost (and no change in the language semantics) except for the specific idiom involving dict, which was incorrectly taking a shortcut. -- --Guido van Rossum (python.org/~guido) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com