dict.has_key() is deprecated
modern syntax for raise-ing exceptions