view python/pydc/pydc.pyi @ 63:9b6cdffd30dd

- further fixes of inccorect overflow errors for int (and long on LLP64 systems) * prev commit had bugs * added overflow tests for also int, long, long long (for both, lp64 and llp64) - while at it, fixing a reference leak when not using python with utf8 caching
author Tassilo Philipp
date Sun, 19 May 2024 15:33:18 +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