PY: Made the Python version a bit more Pythonic