Python3 字典无has_key()方法,调用报AttributeError: 'dict' object has no attribute 'has_key'错误...

可以改成以下形式:

if locatorMethod.lower() in self.locationTypeDict.keys():

 

转载于:https://www.cnblogs.com/yaoliping/p/9399399.html