view python/pydc/pydc.pyi @ 65:75a4082f0fce

- refactoring of deprecated/removed func PyEval_CallObject()
author Tassilo Philipp
date Sun, 19 May 2024 15:45:13 +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