🎉 feat(lazy_load.py): add LazyLoadDictBase class to provide lazy loading of a dictionary of all types

🐛 fix(lazy_load.py): implement _build_dict() and get_type_dict() methods to avoid NotImplementedError
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-05 23:13:51 -03:00
commit 3442521f64

View file

@ -0,0 +1,15 @@
class LazyLoadDictBase:
def __init__(self):
self._all_types_dict = None
@property
def all_types_dict(self):
if self._all_types_dict is None:
self._all_types_dict = self._build_dict()
return self._all_types_dict
def _build_dict(self):
raise NotImplementedError
def get_type_dict(self):
raise NotImplementedError