PP constraint

additional to #1237, targeted at 1.7.x
PEP8 warns that "k in d" is preferable to "has_key"