view python/pydc/pydc.pyi @ 61:c5a69c454963 default tip

- allow use of 'None' with 'Z' - bumped version to 1.4 (be in sync current dyncall version)
author Tassilo Philipp
date Mon, 03 Apr 2023 19:06:07 +0200
parents 8e905c0798c7
children
line wrap: on
line source

import sys
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
H = TypeVar('H')

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: ...
def new_callback(c_signature: str, f: Callable) -> H: ...  # note: only callbacks with positional args
def free_callback(cbhandle: H) -> None: ...
def p2Z(ptr: int) -> Optional[str]: ...  # note: only correct for python 3