has_key not available in python 3