Style change, avoid unnecessary dictionary .keys() method call

Based on a GitHub comment by @namn refering to Guido's email:
https://mail.python.org/pipermail/python-dev/2014-April/134187.html