Try this >>> sample = {'t':True, 'f':False} >>> 't' in sample True >>> type('t' in sample) <type 'bool'> >>> 't' in sample == True False Why is this? Now try >>> bool('t' in sample) == True True Can someone explain what is going on?