A function is an object. Try this in the Python shell:
All you’re doing with that is assigning an attribute to that object.
In Django? Not at the “application” layer, no.
You’d need to be a lot more specific about what exactly you’re trying to do with that to answer that question.
Keep in mind that in a production environment, classes are shared between requests - but not shared between processes. Keeping those types of values synchronized between worker processes would be a lot more effort than it’s worth.