perf: cache action widgets to don't recalculate it

This commit is contained in:
Gleb Smirnov 2022-02-19 12:59:42 +03:00
parent bb3f87ae51
commit cfa7278568
No known key found for this signature in database
GPG key ID: 559DB6D1D625EFAB

View file

@ -19,8 +19,10 @@
import typing as T import typing as T
from .response_id import ResponseId from functools import cached_property
from .common import * from .common import *
from .response_id import ResponseId
class ObjectContent(AstNode): class ObjectContent(AstNode):
@ -81,7 +83,7 @@ class Object(AstNode):
if self.gir_class: if self.gir_class:
return self.gir_class.doc return self.gir_class.doc
@property @cached_property
def action_widgets(self) -> T.List[ResponseId]: def action_widgets(self) -> T.List[ResponseId]:
"""Get list of widget's action widgets. """Get list of widget's action widgets.