Skip to content

Commit

Permalink
FIXES bytecodealliance#137: make calling wasm from python 7x faster
Browse files Browse the repository at this point in the history
  • Loading branch information
muayyad-alsadi committed Apr 5, 2023
1 parent 5bb5c39 commit a67ecc0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_simd_i8x16_add(self):
add_v128 = partial(add_v128_f, store)
a = vector_type(*(i for i in range(16)))
b = vector_type(*(40 + i for i in range(16)))
c = add_v128(a, b)
c: list[int] = add_v128(a, b) # type: ignore
self.assertEqual([v for v in c], [i + j for i, j in zip(a, b)])

def test_calls(self):
Expand Down
2 changes: 1 addition & 1 deletion wasmtime/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __str__(self) -> str:
return 'anyref'
if kind == ffi.WASM_FUNCREF.value:
return 'funcref'
return 'ValType(%d)' % kind
return 'ValType(%d)' % kind # type: ignore

def __del__(self) -> None:
if not hasattr(self, '_owner') or not hasattr(self, '_ptr'):
Expand Down
2 changes: 1 addition & 1 deletion wasmtime/_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _unintern(val: int) -> typing.Any:


def get_valtype_attr(ty: ValType) -> str:
return val_id2attr[wasm_valtype_kind(ty._ptr)]
return val_id2attr[wasm_valtype_kind(ty._ptr)] # type: ignore


def val_getter(store_id: int, val_raw: wasmtime_val_raw_t, attr: str) -> typing.Union[int, float, "wasmtime.Func", typing.Any]:
Expand Down

0 comments on commit a67ecc0

Please sign in to comment.