summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMaja Kądziołka <maya@compilercrim.es>2023-05-19 15:58:13 +0200
committerPeter LaFosse <peter@vector35.com>2023-05-26 13:42:22 -0400
commit0c63f927ead0f78184a7526ce1c707a88e7f52ad (patch)
treeafa3cfc44de9d20989750ad47c5342510640aac9 /python
parenta05596610bbbe9274d9300882fbbbfb41eec107d (diff)
Add some missing type annotations
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py4
-rw-r--r--python/enterprise.py2
-rw-r--r--python/platform.py4
-rw-r--r--python/types.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index fa98e5cd..68263acd 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -2052,7 +2052,7 @@ class BinaryView:
self._platform = None
self._endianness = None
- def __enter__(self):
+ def __enter__(self) -> 'BinaryView':
return self
def __exit__(self, type, value, traceback):
@@ -5266,7 +5266,7 @@ class BinaryView:
def __init__(self, view: 'BinaryView'):
self._view = view
- def __enter__(self):
+ def __enter__(self) -> None:
core.BNBeginBulkModifySymbols(self._view.handle)
def __exit__(self, type, value, traceback):
diff --git a/python/enterprise.py b/python/enterprise.py
index 7d4cc4aa..a6f03836 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -342,7 +342,7 @@ class LicenseCheckout:
self.acquired_license = False
self.desired_release = release
- def __enter__(self):
+ def __enter__(self) -> None:
# UI builds have their own license manager
if binaryninja.core_ui_enabled():
return
diff --git a/python/platform.py b/python/platform.py
index ae124080..c7651373 100644
--- a/python/platform.py
+++ b/python/platform.py
@@ -306,7 +306,7 @@ class Platform(metaclass=_PlatformMetaClass):
return result
@property
- def type_libraries(self):
+ def type_libraries(self) -> List['typelibrary.TypeLibrary']:
count = ctypes.c_ulonglong(0)
libs = core.BNGetPlatformTypeLibraries(self.handle, count)
assert libs is not None, "core.BNGetPlatformTypeLibraries returned None"
@@ -316,7 +316,7 @@ class Platform(metaclass=_PlatformMetaClass):
core.BNFreeTypeLibraryList(libs, count.value)
return result
- def get_type_libraries_by_name(self, name):
+ def get_type_libraries_by_name(self, name) -> List['typelibrary.TypeLibrary']:
count = ctypes.c_ulonglong(0)
libs = core.BNGetPlatformTypeLibrariesByName(self.handle, name, count)
assert libs is not None, "core.BNGetPlatformTypeLibrariesByName returned None"
diff --git a/python/types.py b/python/types.py
index 0b68bd54..52426474 100644
--- a/python/types.py
+++ b/python/types.py
@@ -521,7 +521,7 @@ class MutableTypeBuilder(Generic[TB]):
confidence: int
user: bool = True
- def __enter__(self):
+ def __enter__(self) -> TB:
return self.type
def __exit__(self, type, value, traceback):