Add useful repr to all data classes.

This commit is contained in:
Rapptz
2016-12-30 04:34:42 -05:00
parent ec6c7f8b34
commit dceba9d962
12 changed files with 48 additions and 1 deletions

View File

@@ -61,6 +61,9 @@ class Game:
def __str__(self):
return self.name
def __repr__(self):
return '<Game name={0.name!r} type={0.type!r} url={0.url!r}>'.format(self)
def _iterator(self):
for attr in self.__slots__:
value = getattr(self, attr, None)