summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/function.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/python/function.py b/python/function.py
index d065f454..856d9cca 100644
--- a/python/function.py
+++ b/python/function.py
@@ -960,25 +960,21 @@ class Function:
return None
return highlevelil.HighLevelILFunction(self.arch, result, self)
+ # TODO: Uncomment, move below the property decorator, and mark deprecated after the next stable
#@deprecation.deprecated(details="Use .type instead.")
- # Uncomment, move below the property decorator,
- # and mark deprecated after the next stable
@property
def function_type(self) -> 'types.FunctionType':
"""
Function type object, can be set with either a string representing the function prototype
(`str(function)` shows examples) or a :py:class:`Type` object
"""
- return types.FunctionType(core.BNGetFunctionType(self.handle), platform=self.platform)
+ return self.type
+ # TODO: Uncomment, move below the setter decorator, and mark deprecated after the next stable
+ #@deprecation.deprecated(details="Use .type instead.")
@function_type.setter
- def function_type(self, value: Union['types.FunctionType', str]) -> None: # type: ignore
- if isinstance(value, str):
- (parsed_value, new_name) = self.view.parse_type_string(value)
- self.name = str(new_name)
- self.set_user_type(parsed_value)
- else:
- self.set_user_type(value)
+ def function_type(self, value: Union['types.FunctionType', str]) -> None:
+ self.type = value
@property
def type(self) -> 'types.FunctionType':
@@ -989,7 +985,7 @@ class Function:
return types.FunctionType(core.BNGetFunctionType(self.handle), platform=self.platform)
@type.setter
- def type(self, value: Union['types.FunctionType', str]) -> None: # type: ignore
+ def type(self, value: Union['types.FunctionType', str]) -> None:
if isinstance(value, str):
(parsed_value, new_name) = self.view.parse_type_string(value)
self.name = str(new_name)