Stack replaced with Python assignment statement