Fix a bug in the model class
The bug would hide any attribute with a underscore in the middle, not just those with starting or trailing underscore(private variables)
This commit is contained in:
@@ -63,8 +63,8 @@ class Model:
|
||||
raise Exception(f"{self.__class__.__name__} has no attribute {name!r}")
|
||||
super(Model, self).__setattr__(name, value)
|
||||
def __repr__(self):
|
||||
return "Card(%s)" % \
|
||||
", ".join(f"{i}={getattr(self, i)!r}" for i in dir(self) if "_" not in i)
|
||||
return self.__class__.__name__ + "(%s)" % \
|
||||
", ".join(f"{i}={getattr(self, i)!r}" for i in dir(self) if "_" not in (i[0], i[-1]))
|
||||
__str__ = __repr__
|
||||
|
||||
#fileloader:
|
||||
|
||||
Reference in New Issue
Block a user