|
1 | 1 | from contextlib import contextmanager |
2 | 2 | from ctypes import POINTER, byref, CFUNCTYPE, c_void_p, cast |
3 | 3 | import ctypes |
4 | | -from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError |
| 4 | +from wasmtime import Store, FuncType, Val, IntoVal, Trap, WasmtimeError, ValType |
5 | 5 | from . import _ffi as ffi |
6 | 6 | from ._extern import wrap_extern |
7 | 7 | from typing import Callable, Optional, Generic, TypeVar, List, Union, Tuple, cast as cast_type, Sequence |
|
33 | 33 | WASMTIME_EXTERNREF.value: 'externref', |
34 | 34 | } |
35 | 35 |
|
36 | | -def get_valtype_attr(ty): |
| 36 | +def get_valtype_attr(ty: ValType): |
37 | 37 | return val_id2attr[wasm_valtype_kind(ty._ptr)] |
38 | 38 |
|
39 | 39 | class Func: |
@@ -99,7 +99,7 @@ def _extract_return(self, vals_raw: ctypes.Array[wasmtime_val_raw_t]) -> Union[I |
99 | 99 | # we can use tuple construct, but I'm using list for compatability |
100 | 100 | return [getattr(val_raw, ret_str) for val_raw, ret_str in zip(vals_raw, self._results_str)] |
101 | 101 |
|
102 | | - def _init_call(self, ty): |
| 102 | + def _init_call(self, ty: FuncType): |
103 | 103 | """init signature properties used by call""" |
104 | 104 | self._ty = ty |
105 | 105 | ty_params = ty.params |
|
0 commit comments