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:
2017-12-26 19:01:48 +01:00
parent 1aa3c569a8
commit 3c85e84272
+2 -2
View File
@@ -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: