Skip to content

Commit ade09b7

Browse files
committed
fix mypy
1 parent ff9d01f commit ade09b7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/pointers/bindings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def _make_char_pointer(data: StringLike) -> Union[bytes, ctypes.c_char_p]:
240240

241241
is_typed_ptr: bool = isinstance(data, TypedCPointer)
242242

243-
if isinstance(data, VoidPointer) or is_typed_ptr:
243+
if isinstance(data, VoidPointer) or isinstance(data, TypedCPointer):
244+
# mypy is forcing me to call this twice
244245
if is_typed_ptr and (data.type is not bytes):
245246
raise InvalidBindingParameter(
246247
f"{data} does not point to bytes",

src/pointers/c_pointer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ def size(self):
9494
"""Size of the pointer."""
9595
return self._size
9696

97+
# i need to repeat these for type safety
9798
@property
98-
def type(self) -> T:
99+
def type(self) -> T: # type: ignore
99100
"""Type of the pointer."""
100-
return self._type
101+
return self._type # type: ignore
101102

102-
# i need to repeat these for type safety
103103
def __iter__(self) -> Iterator[T]:
104104
"""Dereference the pointer."""
105105
return iter({self.dereference()})

0 commit comments

Comments
 (0)
close