Unicode and dictionaries

Ben Finney ben+python at benfinney.id.au
Sat Jan 16 18:56:14 EST 2010


gizli <mehmetf at gmail.com> writes:

> >>> test_dict = {u'öğe':1}
> >>> u'öğe' in test_dict.keys()
> True
> >>> 'öğe' in test_dict.keys()
> True

I would call this a bug. The two objects are different, so the latter
expression should return ‘False’.

FYI, ‘foo in bar.keys()’ is easier to spell as ‘foo in bar’.

-- 
 \       “It is wrong to think that the task of physics is to find out |
  `\         how nature *is*. Physics concerns what we can *say* about |
_o__)                                             nature…” —Niels Bohr |
Ben Finney



More information about the Python-list mailing list