Simple function chaining in Python