[issue2646] Python does not accept unicode keywords

Alexander Belopolsky report at bugs.python.org
Thu Apr 17 06:43:50 CEST 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> 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 <report at bugs.python.org>
<http://bugs.python.org/issue2646>
__________________________________


More information about the Python-bugs-list mailing list