+1 for Pythonic code