Use slots for template RenderInfo (#93337)

pull/92605/head
J. Nick Koston 2023-05-22 01:52:49 -05:00 committed by GitHub
parent 31c0374c98
commit aa937b1640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -329,6 +329,22 @@ _cached_literal_eval = lru_cache(maxsize=EVAL_CACHE_SIZE)(literal_eval)
class RenderInfo:
"""Holds information about a template render."""
__slots__ = (
"template",
"filter_lifecycle",
"filter",
"_result",
"is_static",
"exception",
"all_states",
"all_states_lifecycle",
"domains",
"domains_lifecycle",
"entities",
"rate_limit",
"has_time",
)
def __init__(self, template: Template) -> None:
"""Initialise."""
self.template = template