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

@@ -29,8 +29,7 @@ class Record:
self.__dict__.update(kwargs)
def __repr__(self):
cls_name = self.__class__.__name__
return f'<{cls_name} serial={self.serial!r}>'
return f'<{self.__class__.__name__} serial={self.serial!r}>'
@staticmethod # <3>
def fetch(key):
@@ -44,10 +43,9 @@ class Record:
class Event(Record): # <1>
def __repr__(self):
if hasattr(self, 'name'): # <2>
cls_name = self.__class__.__name__
return f'<{cls_name} {self.name!r}>'
else:
try:
return f'<{self.__class__.__name__} {self.name!r}>' # <2>
except AttributeError:
return super().__repr__()
@property