On Fri, Apr 16, 2010 at 2:22 PM, Maciej Fijalkowski <fij...@gmail.com> wrote: > On Fri, Apr 16, 2010 at 3: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. >> 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). >> >> >> Raymond >> > > On the other hand, we (as in alternative python implementations) are > paying the price because people use it, even if only accidentally. If > CPython detects such cases and complain early, it would be much easier > for applications to stay cross-interpreter compatible (and I don't > think it's a huge burden for them to get rid of that, django already > did).
+1. Apparently dict(x, **y) is going around as "cool hack" for "call x.update(y) and return x". Personally I find it more despicable than cool. -- --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