From 166a67bfa7f00549c7de23694edb22a9e776413f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Mon, 16 Mar 2020 21:27:46 -0400 Subject: add __lt__ to the function class so they can be sorted --- python/function.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python') diff --git a/python/function.py b/python/function.py index 029b70f3..e0d179b2 100644 --- a/python/function.py +++ b/python/function.py @@ -750,6 +750,11 @@ class Function(object): core.BNReleaseAdvancedFunctionAnalysisDataMultiple(self.handle, self._advanced_analysis_requests) core.BNFreeFunction(self.handle) + def __lt__(self, value): + if not isinstance(value, Function): + return False + return self.start < value.start + def __eq__(self, value): if not isinstance(value, Function): return False -- cgit v1.3.1