Mercurial > pub > dyncall > bindings
diff python/pydc/pydc.pyi @ 54:918dab7a6606
- added callback support (comes with some bigger refactoring)
- allow CPython's Py{CObject,Capsule} to be used as 'p'ointers
author | Tassilo Philipp |
---|---|
date | Tue, 02 Feb 2021 20:42:02 +0100 |
parents | edf5c85de5ac |
children | 8e905c0798c7 |
line wrap: on
line diff
--- a/python/pydc/pydc.pyi Fri Jan 22 15:18:56 2021 +0100 +++ b/python/pydc/pydc.pyi Tue Feb 02 20:42:02 2021 +0100 @@ -1,5 +1,5 @@ import sys -from typing import Optional, Any, TypeVar +from typing import Optional, Any, TypeVar, Callable # Handle type, depending on python version this is either internal type # PyCObject or PyCapsule, neither of one can be used as annotation @@ -10,4 +10,6 @@ def free(libhandle: H) -> None: ... def get_path(libhandle: Optional[H]) -> str: ... def call(funcptr: H, signature: str, *arguments: Any) -> Any: ... +def new_callback(c_signature: str, f: Callable) -> H: ... # note: only callbacks with positional args +def free_callback(cbhandle: H) -> None: ...