Pure functions in python