inserting Unicode character in dictionary - Python

Marc 'BlackJack' Rintsch bj_666 at
Fri Oct 17 19:24:35 CEST 2008

On Fri, 17 Oct 2008 13:07:38 -0400, gita ziabari wrote:

> The following code does not work for unicode characters:
> keyword = dict()
> kw = 'генских'
> keyword.setdefault(key, []).append (kw)
> It works fine for inserting ASCII character. Any suggestion?

What do you mean by "does not work"?  And you are aware that the above 
snipped doesn't involve any unicode characters!?  You have a byte string 
there -- type `str` not `unicode`.

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list