diff options
| author | Keryn Knight <keryn@kerynknight.com> | 2022-01-29 12:18:46 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-02 15:22:46 +0100 |
| commit | 84418ba3e3e42289fc31746523dfcb5e0cce5a28 (patch) | |
| tree | 84f669ef961fbfdf11335f2bda9d5986e3578d45 /django/template/base.py | |
| parent | b7d1da5a62fe4141beff2bfea565f7ef0038c94c (diff) | |
Fixed #33474 -- Added __slots__ to Variable and FilterExpression.
Diffstat (limited to 'django/template/base.py')
| -rw-r--r-- | django/template/base.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 <Variable: 'variable'> """ + + __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 |
