summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index be4f28be..eab2373a 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -1316,6 +1316,9 @@ class Segment:
def length(self):
return int(core.BNSegmentGetLength(self.handle))
+ def __bool__(self):
+ return True
+
def __eq__(self, other):
if not isinstance(other, self.__class__):
return NotImplemented
@@ -1415,6 +1418,9 @@ class Section:
def __len__(self):
return self.length
+ def __bool__(self):
+ return True
+
def __eq__(self, other):
if not isinstance(other, self.__class__):
return NotImplemented
@@ -2050,6 +2056,9 @@ class BinaryView:
def length(self):
return int(core.BNGetViewLength(self.handle))
+ def __bool__(self):
+ return True
+
def __eq__(self, other):
if not isinstance(other, self.__class__):
return NotImplemented