[issue2646] Python does not accept unicode keywords
Daniel Diniz aja...@gmail.com added the comment: Fixed in r68805, #4978. -- nosy: +ajaksu2 resolution: - out of date stage: - committed/rejected status: open - closed superseder: - allow unicode keyword args ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2646] Python does not accept unicode keywords
Changes by Martin v. Löwis [EMAIL PROTECTED]: -- versions: +Python 2.6 -Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2646] Python does not accept unicode keywords
New submission from John (J5) Palmieri [EMAIL PROTECTED]: # given this function def a(**kwargs): pass # this works a(**{'b':'c'}) # this throws a format error a(**{u'b':'c'}) I am using a web framework (TurboGears w/ genshi templating) which often pass around dictionaries as keyword arguments in order to have 1 to 1 representation of json data and URL parameters. This is usually fine except when using libraries such as simplejson which encodes all of the keywords as unicode. Attached is a patch which is most likely just the tip of the iceberg but hopefully it turns out to be this easy. -- components: Library (Lib) files: allow_unicode_keywords.patch keywords: patch messages: 65567 nosy: j5 severity: normal status: open title: Python does not accept unicode keywords type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file10043/allow_unicode_keywords.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2646] Python does not accept unicode keywords
John (J5) Palmieri [EMAIL PROTECTED] added the comment: Someone has convinced me that it is not worth bothering the dev team since they will have this fixed in P3k the right way. If it is easy then please fix this, otherwise feel free to close. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2646] Python does not accept unicode keywords
Alexander Belopolsky [EMAIL PROTECTED] added the comment: I would say this is a good idea for 2.6. Note that C functions are more forgiving: from datetime import * date(1,2,**{u'day':10}) datetime.date(1, 2, 10) dict(**{u'x':1,2:3,():5}) {u'x': 1, 2: 3, (): 5} but date(1,2,**{u'day':10,u'x':20}) Traceback (most recent call last): File stdin, line 1, in module TypeError: keywords must be strings I would not advocate making ** completely promiscuous (as in dict(..) above), but permitting unicode strings will allow for easier 3.0 transitions. I'll submit a patch. -- nosy: +belopolsky __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2646] Python does not accept unicode keywords
Changes by Alexander Belopolsky [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10045/issue2646.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2646 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com