new: __repr__ method in WarningList

pull/5/head
Raphaël Vinot 2019-05-13 10:24:47 +02:00
parent dd876fdba2
commit 7c6c5e7296
1 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,9 @@ class WarningList():
if not self._network_objects: if not self._network_objects:
self.slow_search = False self.slow_search = False
def __repr__(self):
return '<{self.__class__.__name__}(type="{self.name}", version="{self.version}", description="{self.description}")'.format(self=self)
def __contains__(self, value): def __contains__(self, value):
if self.slow_search: if self.slow_search:
return self._slow_search(value) return self._slow_search(value)