On Fri, Dec 19, 2008 at 4:40 PM, leone <[email protected]> wrote:
>
> It is normal this behaviour? It is annoying.
> This is OK:
> data = {'name':'aaaaa','passwd':'bbbbb'}
> db.insert('prova', **data)
>
> This is wrong:
> data = {u'name':u'aaaaa',u'passwd':u'bbbbb'}
> db.insert('prova', **data)
> TypeError: insert() keywords must be strings

function keyword arguments can not be unicode values (this is going to
change with python 3000).

>>> def add(x, y): return x + y
...
>>> kw = {u'x': 1, u'y': 2}
>>> add(**kw)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: add() keywords must be strings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to