Commit 1ef34070 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

implement __nonzero__() for faster boolean check.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18533 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e371094e
......@@ -666,6 +666,9 @@ class WorkflowHistoryList(Persistent):
def __mul__(self, x):
return self.__class__(tuple(self) * x)
def __nonzero__(self):
return len(self._slots) != 0 or self._prev is not None
def __repr__(self):
#return '%s' % repr(tuple(self.__iter__()))
return '<%s object at 0x%x %r>' % (self.__class__.__name__, id(self), tuple(self))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment