﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6728	Dictionary with django object as key failing.	dl@…	nobody	"I'm using a dictionary to store a mapping between django objects and wxPython controls.
{{{
>>> print controls
controls = {
<MyObject: P001>: <wxTextCtrl instance at _08d89808_p_wxTextCtrl>,
<MyObject: P010>: <wxTextCtrl instance at _28449708_p_wxTextCtrl>,
<MyObject: P007>: <wxTextCtrl instance at _805f9808_p_wxTextCtrl>,
<MyObject: P006>: <wxTextCtrl instance at _78699b08_p_wxTextCtrl>,
<MyObject: P009>: <wxTextCtrl instance at _d8099a08_p_wxTextCtrl>,
<MyObject: P008>: <wxTextCtrl instance at _08ac9908_p_wxTextCtrl>,
<MyObject: P011>: <wxTextCtrl instance at _4834b008_p_wxTextCtrl>
}
}}}

I need to find the appropriate control fo a given value, but using the MyObject as key is behaving strangely:

{{{
>>> print value
<MyObject: P001>
>>> print controls[value]
KeyError: <MyObject: P001>
>>> print value in controls
False
>>> print value in controls.keys()
True
>>> for key, control in controls.items():
...     print ""%r %r %r"" % ( key == value, key, value)
True <MyObject: P001> <MyObject: P001>
False <MyObject: P001> <MyObject: P010>
False <MyObject: P001> <MyObject: P007>
False <MyObject: P001> <MyObject: P006>
False <MyObject: P001> <MyObject: P009>
False <MyObject: P001> <MyObject: P008>
False <MyObject: P001> <MyObject: P011>
}}}

"		closed	Core (Other)	0.96		worksforme	object dictionary key model lookup		Unreviewed	0	0	0	0	0	0
