[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-24 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r80450. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Pytho

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-24 Thread Benjamin Peterson
Changes by Benjamin Peterson : Added file: http://bugs.python.org/file17071/refactor_a_bit.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: Now with the suggested dictionary speed hack. -- Added file: http://bugs.python.org/file16957/with_speed_hack.patch ___ Python tracker ___ __

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: And here's a patch for the correct Python version... -- Added file: http://bugs.python.org/file16956/no_dict_non_string_kwarg.patch ___ Python tracker __

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's a patch. It adds a new function, PyArg_ValidateKeywordArguments. -- keywords: +patch Added file: http://bugs.python.org/file16955/no_dict_non_string_keyword_args.patch ___ Python tracker

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: They are already checked for pure python functions. -- nosy: +benjamin.peterson ___ Python tracker ___ __

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Does this mean that every time someone uses **kwds, that the entire dictionary will need to be scanned for invalid keys? So every API that accepts and passes through **kwds will be slowed on every time it is called. Is there any offsetting benefit?

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Alex
Alex added the comment: Guido seems to be favoring disallowing it, not ignoring it[0]. http://mail.python.org/pipermail/python-dev/2010-April/099435.html -- nosy: +alex ___ Python tracker _

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Eric Smith
Eric Smith added the comment: I agree with Mark. Guido's point was that if it's implementation defined, you'll have portability problems: http://mail.python.org/pipermail/python-dev/2010-April/099435.html -- ___ Python tracker

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: > I agree with Guido that we just call this an undefined, implementation > specific behavior. Actually I think that was exactly what Guido was *disagreeing* with. :) -- ___ Python tracker

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think this is worth the performance hit or worth the deprecate/remove exercise. I agree with Guido that we just call this an undefined, implementation specific behavior. This behavior has existed for a very long time with no ill-effects. Marking

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: Update: IronPython also produces a TypeError here (thanks Michael Foord and Dino Viehland). -- ___ Python tracker ___

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Mark Dickinson
Mark Dickinson added the comment: The issue applies to dict.update as well: >>> d = {1:2} >>> d.update({3:4}, **{5:6}) >>> d {1: 2, 3: 4, 5: 6} -- ___ Python tracker ___ ___

[issue8419] dict constructor allows invalid identifiers in **kwargs

2010-04-16 Thread Mark Dickinson
New submission from Mark Dickinson : In all versions of CPython right now, the following works. >>> dict({1:2}, **{3:4}) {1: 2, 3: 4} Other Python implementations raise TypeError for this; CPython should probably do the same, beginning with deprecating this behaviour in Python 3.2 and removi