I have a python dictionary that has objects as keys. The objects have certain attributes say:
class Ex: text count id
How do I enable constant time searching for an object with value equal to some text 'xyz'
Ex obj1 Ex obj2 Ex obj3 map = {obj1 : 1, obj2 : 2, obj3 : 3}
I want to know whether the 'has_key' or 'in' method of Python dictionary can achieve fetching objects with a particular attribute in constant time,i.e.,
map.has_key('xyz') will return me the presence of the corresponding object with text attribute as 'xyz' in constant time.