remove redundant code: 'key in dict_obj' equals to 'key in dict_obj.keys()'
fix an wrong doctext
fixes for python 3 compatibility