mercurial/smartset.py
changeset 31476 413b44003462
parent 31446 9a94239e4f12
child 32148 2cfdf5241096
--- a/mercurial/smartset.py	Mon Mar 13 21:58:43 2017 -0700
+++ b/mercurial/smartset.py	Mon Mar 13 12:40:14 2017 -0700
@@ -40,6 +40,8 @@
         """True if the smartset is not empty"""
         raise NotImplementedError()
 
+    __bool__ = __nonzero__
+
     def __contains__(self, rev):
         """provide fast membership testing"""
         raise NotImplementedError()
@@ -267,6 +269,8 @@
     def __nonzero__(self):
         return bool(len(self))
 
+    __bool__ = __nonzero__
+
     def sort(self, reverse=False):
         self._ascending = not bool(reverse)
         self._istopo = False
@@ -420,6 +424,8 @@
             return True
         return False
 
+    __bool__ = __nonzero__
+
     def __len__(self):
         # Basic implementation to be changed in future patches.
         # until this gets improved, we use generator expression
@@ -592,6 +598,8 @@
     def __nonzero__(self):
         return bool(self._r1) or bool(self._r2)
 
+    __bool__ = __nonzero__
+
     @util.propertycache
     def _list(self):
         if not self._genlist:
@@ -752,6 +760,8 @@
             return True
         return False
 
+    __bool__ = __nonzero__
+
     def __contains__(self, x):
         if x in self._cache:
             return self._cache[x]
@@ -970,6 +980,8 @@
             return True
         return False
 
+    __bool__ = __nonzero__
+
     def __len__(self):
         if not self._hiddenrevs:
             return abs(self._end - self._start)