1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #33474 -- Added __slots__ to Variable and FilterExpression.

This commit is contained in:
Keryn Knight 2022-01-29 12:18:46 +00:00 committed by Mariusz Felisiak
parent b7d1da5a62
commit 84418ba3e3

View File

@ -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