replace has_key by in (for python 3.3, fixed #4)