2e reviewed manuscript

This commit is contained in:
Luciano Ramalho
2021-11-12 11:33:12 -03:00
parent f5e3cb8ad3
commit 80f7f84274
32 changed files with 323 additions and 156 deletions

View File

@@ -62,11 +62,14 @@ class FrozenJSON:
# end::EXPLORE1[]
def __getattr__(self, name):
if hasattr(self.__data, name):
try:
return getattr(self.__data, name)
else:
except AttributeError:
return FrozenJSON.build(self.__data[name])
def __dir__(self): # <5>
return self.__data.keys()
@classmethod
def build(cls, obj):
if isinstance(obj, abc.Mapping):