Pythonify it

No functional changes, just stylistic.