Sharing a mutable reference with Python

Background As part of my ongoing project to reimplement Django&rsquo;s templating language in Rust, I have been adding support for custom template tags . Simple tags The simplest custom tag will look something like: # time_tags.py from datetime import datetime from django import template register = template . Library() @register.simple_tag def time (format_string): now = datetime . now() return…