Mercurial > pub > dyncall > bindings
diff python/pydc/pydc-stubs/pydc.pyi @ 46:c21d1c2c84e1
- removed pydc.py wrapper overhead (which only called pydcext.so functions, directly, anyways)
* implies renaming pydcext.* to pydc.*
* while at it, iterate directly over args that are passed in (before we did extract fptr, sig and a tuple for the args and iterated over latter afterwards); we might have a tiny perf improvement now
- added type stub as package_data
author | Tassilo Philipp |
---|---|
date | Fri, 13 Nov 2020 14:10:31 +0100 |
parents | |
children | 44045db8fa5f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/pydc/pydc-stubs/pydc.pyi Fri Nov 13 14:10:31 2020 +0100 @@ -0,0 +1,15 @@ +import sys +from typing import Optional, Any, TypeVar + +# Handle type is different, depending on python version +if sys.version_info < (2, 7) or (sys.version_info >= (3, 0) and sys.version_info < (3, 1)): + H = TypeVar('H', PyCObject) +else: + H = TypeVar('H', PyCapsule) + +def load(libpath: Optional[str]) -> H: ... +def find(libhandle: H, symbol: str) -> H: ... +def free(libhandle: H) -> None: ... +def get_path(libhandle: Optional[H]) -> str: ... +def call(funcptr: H, signature: str, *arguments: Any) -> Any: ... +