mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Use cached_property instead of a custom decorator
This commit is contained in:
parent
1c1a5e3266
commit
f197e68589
4 changed files with 15 additions and 28 deletions
|
@ -19,11 +19,10 @@
|
|||
|
||||
|
||||
from collections import defaultdict
|
||||
from functools import cached_property
|
||||
import typing as T
|
||||
from xml import sax
|
||||
|
||||
from .utils import lazy_prop
|
||||
|
||||
|
||||
# To speed up parsing, we ignore all tags except these
|
||||
PARSE_GIR = set([
|
||||
|
@ -40,7 +39,7 @@ class Element:
|
|||
self.children: T.Dict[str, T.List["Element"]] = defaultdict(list)
|
||||
self.cdata_chunks: T.List[str] = []
|
||||
|
||||
@lazy_prop
|
||||
@cached_property
|
||||
def cdata(self):
|
||||
return ''.join(self.cdata_chunks)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue