From 84418ba3e3e42289fc31746523dfcb5e0cce5a28 Mon Sep 17 00:00:00 2001 From: Keryn Knight Date: Sat, 29 Jan 2022 12:18:46 +0000 Subject: [PATCH] Fixed #33474 -- Added __slots__ to Variable and FilterExpression. --- django/template/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django/template/base.py b/django/template/base.py index 078be8b383..e55293b8d1 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -651,6 +651,9 @@ class FilterExpression: >>> fe.var """ + + __slots__ = ('token', 'filters', 'var', 'is_var') + def __init__(self, token, parser): self.token = token matches = filter_re.finditer(token) @@ -777,6 +780,8 @@ class Variable: (The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.') """ + __slots__ = ('var', 'literal', 'lookups', 'translate', 'message_context') + def __init__(self, var): self.var = var self.literal = None