gizli 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’.
--
\
>>> This ought to be a bug; objects that compare equal and are hashable
>>> must have the same hash code.
>> It's not a bug. Changing the default encoding is not really supported,
>> let alone changing it to anything but latin-1, precisely for the reasons
>> you discuss.
>>
>> If you do change the
On Sun, 17 Jan 2010 10:49:44 +0100, Martin v. Loewis wrote:
>> This ought to be a bug; objects that compare equal and are hashable
>> must have the same hash code.
>
> It's not a bug. Changing the default encoding is not really supported,
> let alone changing it to anything but latin-1, precisely
> Thanks to all of you. This once again proves how deep you can get
> yourself into a mess if you mix unicode and string objects in your
> code!
The specific issue is that you apparently changed the default encoding.
Don't do that, Python will break if you do.
Regards,
Martin
--
http://mail.pyth
> This ought to be a bug; objects that compare equal and are hashable
> must have the same hash code.
It's not a bug. Changing the default encoding is not really supported,
let alone changing it to anything but latin-1, precisely for the reasons
you discuss.
If you do change the default encoding,
On Jan 16, 7:06 pm, Ben Finney wrote:
> Carl Banks writes:
> > On Jan 16, 3:56 pm, Ben Finney wrote:
> > > gizli 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
Carl Banks writes:
> On Jan 16, 3:56 pm, Ben Finney wrote:
> > gizli 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
> > expressi
On Jan 16, 5:38 pm, Carl Banks wrote:
> On Jan 16, 3:58 pm, Steven D'Aprano cybersource.com.au> wrote:
> > On Sat, 16 Jan 2010 15:35:05 -0800, gizli wrote:
> > > Hi all,
>
> > > I am using Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41). I ran
> > > into this issue yesterday and wanted to
On Jan 16, 3:56 pm, Ben Finney wrote:
> gizli 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’.
Except the two
On Jan 16, 3:58 pm, Steven D'Aprano wrote:
> On Sat, 16 Jan 2010 15:35:05 -0800, gizli wrote:
> > Hi all,
>
> > I am using Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41). I ran
> > into this issue yesterday and wanted to check to see if this is a
> > python bug. It seems that there is an i
On Sat, 16 Jan 2010 15:35:05 -0800, gizli wrote:
> Hi all,
>
> I am using Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41). I ran
> into this issue yesterday and wanted to check to see if this is a
> python bug. It seems that there is an inconsistency between lists and
> dictionaries in the
Hi all,
I am using Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41). I
ran into this issue yesterday and wanted to check to see if this is a
python bug. It seems that there is an inconsistency between lists and
dictionaries in the way that unicode objects are handled. Take a look
at the foll
12 matches
Mail list logo