Skip to content

Commit d0913e8

Browse files
FIXES #137: make calling wasm from python 7x faster
1 parent 7bee159 commit d0913e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wasmtime/_func.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from contextlib import contextmanager
22
from ctypes import POINTER, byref, CFUNCTYPE, c_void_p, cast
33
import ctypes
4-
from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError
4+
from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError, ValType
55
from . import _ffi as ffi
66
from ._extern import wrap_extern
77
from typing import Callable, Optional, Generic, TypeVar, List, Union, Tuple, cast as cast_type, Sequence
@@ -33,7 +33,7 @@
3333
WASMTIME_EXTERNREF.value: 'externref',
3434
}
3535

36-
def get_valtype_attr(ty):
36+
def get_valtype_attr(ty: ValType):
3737
return val_id2attr[wasm_valtype_kind(ty._ptr)]
3838

3939
class Func:
@@ -99,7 +99,7 @@ def _extract_return(self, vals_raw: ctypes.Array[wasmtime_val_raw_t]) -> Union[I
9999
# we can use tuple construct, but I'm using list for compatability
100100
return [getattr(val_raw, ret_str) for val_raw, ret_str in zip(vals_raw, self._results_str)]
101101

102-
def _init_call(self, ty):
102+
def _init_call(self, ty: FuncType):
103103
"""init signature properties used by call"""
104104
self._ty = ty
105105
ty_params = ty.params

0 commit comments

Comments
 (0)