Python does not have this feature but I can simulate it by setting function globals just like I did in the template function