From f9851f115b501add28b5b849821dd0525d82e960 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Mon, 8 Nov 2021 13:22:07 -0500 Subject: add pep 484 and 561 compliance, fixes #2747 --- python/bncompleter.py | 6 +++--- python/mediumlevelil.py | 4 ++-- python/py.typed | 0 python/types.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 python/py.typed (limited to 'python') diff --git a/python/bncompleter.py b/python/bncompleter.py index 0063bf5f..ba012a2a 100644 --- a/python/bncompleter.py +++ b/python/bncompleter.py @@ -146,10 +146,10 @@ class Completer: word = word + ' ' matches.append(word) #Not sure why in the console builtins becomes a dict but this works for now. - if hasattr(__builtins__, '__dict__'): # type: ignore remove this ignore > pyright 1.1.149 - builtins = __builtins__.__dict__ # type: ignore remove this ignore > pyright 1.1.149 + if hasattr(__builtins__, '__dict__'): # type: ignore # remove this ignore > pyright 1.1.149 + builtins = __builtins__.__dict__ # type: ignore # remove this ignore > pyright 1.1.149 else: - builtins = __builtins__ # type: ignore remove this ignore > pyright 1.1.149 + builtins = __builtins__ # type: ignore # remove this ignore > pyright 1.1.149 for nspace in [self.namespace, builtins]: for word, val in nspace.items(): if word[:n] == text and word not in seen: diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 6c75e7cc..c4e77af2 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -1886,7 +1886,7 @@ class MediumLevelILSet_var_ssa_field(MediumLevelILInstruction, SetVar, SSA): @property def vars_read(self) -> List[SSAVariable]: - return [self.prev, *self.src.vars_read] # type: ignore we're guaranteed not to return non-SSAVariables here + return [self.prev, *self.src.vars_read] # type: ignore # we're guaranteed not to return non-SSAVariables here @property def vars_written(self) -> List[SSAVariable]: @@ -1946,7 +1946,7 @@ class MediumLevelILSet_var_aliased_field(MediumLevelILInstruction, SetVar, SSA): @property def vars_read(self) -> List[SSAVariable]: - return [self.prev, *self.src.vars_read] # type: ignore we're guaranteed not to return non-SSAVariables here + return [self.prev, *self.src.vars_read] # type: ignore # we're guaranteed not to return non-SSAVariables here @property def operands(self) -> List[MediumLevelILOperandType]: diff --git a/python/py.typed b/python/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/python/types.py b/python/types.py index e1c7474c..5eba9b8d 100644 --- a/python/types.py +++ b/python/types.py @@ -685,7 +685,7 @@ class TypeBuilder: return BoolWithConfidence(result.value, confidence = result.confidence) @const.setter - def const(self, value:BoolWithConfidenceType) -> None: # type: ignore We explicitly allow 'set' type to be different than 'get' type + def const(self, value:BoolWithConfidenceType) -> None: # type: ignore # We explicitly allow 'set' type to be different than 'get' type core.BNTypeBuilderSetConst(self._handle, BoolWithConfidence.get_core_struct(value)) @property @@ -695,7 +695,7 @@ class TypeBuilder: return BoolWithConfidence(result.value, confidence = result.confidence) @volatile.setter - def volatile(self, value:BoolWithConfidenceType) -> None: # type: ignore We explicitly allow 'set' type to be different than 'get' type + def volatile(self, value:BoolWithConfidenceType) -> None: # type: ignore # We explicitly allow 'set' type to be different than 'get' type core.BNTypeBuilderSetVolatile(self._handle, BoolWithConfidence.get_core_struct(value)) @property -- cgit v1.3.1