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

@@ -92,6 +92,9 @@ class Role(Hashable):
def __str__(self):
return self.name
def __repr__(self):
return '<Role id={0.id} name={0.name!r}>'.format(self)
def __lt__(self, other):
if not isinstance(other, Role) or not isinstance(self, Role):
return NotImplemented