mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-25 19:17:16 +08:00
Add defaults for third-party stubs A-D (#9952)
This commit is contained in:
@@ -22,31 +22,33 @@ class FFI:
|
||||
NULL: CType
|
||||
errno: int
|
||||
|
||||
def __init__(self, backend: types.ModuleType | None = ...) -> None: ...
|
||||
def cdef(self, csource: str, override: bool = ..., packed: bool = ..., pack: int | None = ...) -> None: ...
|
||||
def embedding_api(self, csource: str, packed: bool = ..., pack: bool | int | None = ...) -> None: ...
|
||||
def dlopen(self, name: str, flags: int = ...) -> _cffi_backend.Lib: ...
|
||||
def __init__(self, backend: types.ModuleType | None = None) -> None: ...
|
||||
def cdef(self, csource: str, override: bool = False, packed: bool = False, pack: int | None = None) -> None: ...
|
||||
def embedding_api(self, csource: str, packed: bool = False, pack: bool | int | None = None) -> None: ...
|
||||
def dlopen(self, name: str, flags: int = 0) -> _cffi_backend.Lib: ...
|
||||
def dlclose(self, lib: _cffi_backend.Lib) -> None: ...
|
||||
def typeof(self, cdecl: str | CData | types.BuiltinFunctionType | types.FunctionType) -> CType: ...
|
||||
def sizeof(self, cdecl: str | CData) -> int: ...
|
||||
def alignof(self, cdecl: str | CData) -> int: ...
|
||||
def offsetof(self, cdecl: str | CData, *fields_or_indexes: str | int) -> int: ...
|
||||
def new(self, cdecl: str | CType, init: Incomplete | None = ...) -> CData: ...
|
||||
def new(self, cdecl: str | CType, init: Incomplete | None = None) -> CData: ...
|
||||
def new_allocator(
|
||||
self,
|
||||
alloc: Callable[[int], CData] | None = ...,
|
||||
free: Callable[[CData], Any] | None = ...,
|
||||
should_clear_after_alloc: bool = ...,
|
||||
alloc: Callable[[int], CData] | None = None,
|
||||
free: Callable[[CData], Any] | None = None,
|
||||
should_clear_after_alloc: bool = True,
|
||||
) -> _cffi_backend._Allocator: ...
|
||||
def cast(self, cdecl: str | CType, source: CData | int) -> CData: ...
|
||||
def string(self, cdata: CData, maxlen: int = ...) -> bytes | str: ...
|
||||
def string(self, cdata: CData, maxlen: int = -1) -> bytes | str: ...
|
||||
def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ...
|
||||
@overload
|
||||
def from_buffer(self, cdecl: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ...
|
||||
def from_buffer(self, cdecl: ReadableBuffer, require_writable: Literal[False] = False) -> CData: ...
|
||||
@overload
|
||||
def from_buffer(self, cdecl: WriteableBuffer, require_writable: Literal[True]) -> CData: ...
|
||||
@overload
|
||||
def from_buffer(self, cdecl: str | CType, python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ...
|
||||
def from_buffer(
|
||||
self, cdecl: str | CType, python_buffer: ReadableBuffer, require_writable: Literal[False] = False
|
||||
) -> CData: ...
|
||||
@overload
|
||||
def from_buffer(self, cdecl: str | CType, python_buffer: WriteableBuffer, require_writable: Literal[True]) -> CData: ...
|
||||
def memmove(self, dest: CData | WriteableBuffer, src: CData | ReadableBuffer, n: int) -> None: ...
|
||||
@@ -54,27 +56,27 @@ class FFI:
|
||||
def callback(
|
||||
self,
|
||||
cdecl: str | CType,
|
||||
python_callable: None = ...,
|
||||
error: Any = ...,
|
||||
onerror: Callable[[Exception, Any, Any], None] | None = ...,
|
||||
python_callable: None = None,
|
||||
error: Any = None,
|
||||
onerror: Callable[[Exception, Any, Any], None] | None = None,
|
||||
) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
@overload
|
||||
def callback(
|
||||
self,
|
||||
cdecl: str | CType,
|
||||
python_callable: Callable[..., _T],
|
||||
error: Any = ...,
|
||||
onerror: Callable[[Exception, Any, Any], None] | None = ...,
|
||||
error: Any = None,
|
||||
onerror: Callable[[Exception, Any, Any], None] | None = None,
|
||||
) -> Callable[..., _T]: ...
|
||||
def getctype(self, cdecl: str | CType, replace_with: str = ...) -> str: ...
|
||||
def getctype(self, cdecl: str | CType, replace_with: str = "") -> str: ...
|
||||
@overload
|
||||
def gc(self, cdata: CData, destructor: Callable[[CData], Any], size: int = ...) -> CData: ...
|
||||
def gc(self, cdata: CData, destructor: Callable[[CData], Any], size: int = 0) -> CData: ...
|
||||
@overload
|
||||
def gc(self, cdata: CData, destructor: None, size: int = ...) -> None: ...
|
||||
def verify(self, source: str = ..., tmpdir: str | None = ..., **kwargs: Any) -> _cffi_backend.Lib: ...
|
||||
def gc(self, cdata: CData, destructor: None, size: int = 0) -> None: ...
|
||||
def verify(self, source: str = "", tmpdir: str | None = None, **kwargs: Any) -> _cffi_backend.Lib: ...
|
||||
# Technically exists on all OSs, but crashes on all but Windows. So we hide it in stubs
|
||||
if sys.platform == "win32":
|
||||
def getwinerror(self, code: int = ...) -> tuple[int, str] | None: ...
|
||||
def getwinerror(self, code: int = -1) -> tuple[int, str] | None: ...
|
||||
|
||||
def addressof(self, cdata: CData, *fields_or_indexes: str | int) -> CData: ...
|
||||
def include(self, ffi_to_include: FFI) -> None: ...
|
||||
@@ -82,14 +84,14 @@ class FFI:
|
||||
def from_handle(self, x: CData) -> Any: ...
|
||||
def release(self, x: CData) -> None: ...
|
||||
def set_unicode(self, enabled_flag: bool) -> None: ...
|
||||
def set_source(self, module_name: str, source: str, source_extension: str = ..., **kwds: Any) -> None: ...
|
||||
def set_source(self, module_name: str, source: str, source_extension: str = ".c", **kwds: Any) -> None: ...
|
||||
def set_source_pkgconfig(
|
||||
self, module_name: str, pkgconfig_libs: list[str], source: str, source_extension: str = ..., **kwds: Any
|
||||
self, module_name: str, pkgconfig_libs: list[str], source: str, source_extension: str = ".c", **kwds: Any
|
||||
) -> None: ...
|
||||
def distutils_extension(self, tmpdir: str = ..., verbose: bool = ...) -> distutils.core.Extension: ...
|
||||
def distutils_extension(self, tmpdir: str = "build", verbose: bool = True) -> distutils.core.Extension: ...
|
||||
def emit_c_code(self, filename: str) -> None: ...
|
||||
def emit_python_code(self, filename: str) -> None: ...
|
||||
def compile(self, tmpdir: str = ..., verbose: int = ..., target: str | None = ..., debug: bool | None = ...) -> str: ...
|
||||
def compile(self, tmpdir: str = ".", verbose: int = 0, target: str | None = None, debug: bool | None = None) -> str: ...
|
||||
def init_once(self, func: Callable[[], Any], tag: Hashable) -> Any: ...
|
||||
def embedding_init_code(self, pysource: str) -> None: ...
|
||||
def def_extern(self, *args: Any, **kwds: Any) -> None: ...
|
||||
|
||||
@@ -19,7 +19,7 @@ class CTypesData:
|
||||
def __gt__(self, other): ...
|
||||
def __ge__(self, other): ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __repr__(self, c_name: str | None = ...): ...
|
||||
def __repr__(self, c_name: str | None = None): ...
|
||||
|
||||
class CTypesGenericPrimitive(CTypesData):
|
||||
def __hash__(self) -> int: ...
|
||||
@@ -43,7 +43,7 @@ class CTypesBackend:
|
||||
def __init__(self) -> None: ...
|
||||
ffi: Incomplete
|
||||
def set_ffi(self, ffi) -> None: ...
|
||||
def load_library(self, path, flags: int = ...): ...
|
||||
def load_library(self, path, flags: int = 0): ...
|
||||
def new_void_type(self): ...
|
||||
def new_primitive_type(self, name): ...
|
||||
def new_pointer_type(self, BItem): ...
|
||||
@@ -51,24 +51,24 @@ class CTypesBackend:
|
||||
def new_struct_type(self, name): ...
|
||||
def new_union_type(self, name): ...
|
||||
def complete_struct_or_union(
|
||||
self, CTypesStructOrUnion, fields, tp, totalsize: int = ..., totalalignment: int = ..., sflags: int = ..., pack: int = ...
|
||||
self, CTypesStructOrUnion, fields, tp, totalsize: int = -1, totalalignment: int = -1, sflags: int = 0, pack: int = 0
|
||||
): ...
|
||||
def new_function_type(self, BArgs, BResult, has_varargs): ...
|
||||
def new_enum_type(self, name, enumerators, enumvalues, CTypesInt): ...
|
||||
def get_errno(self): ...
|
||||
def set_errno(self, value) -> None: ...
|
||||
def string(self, b, maxlen: int = ...): ...
|
||||
def buffer(self, bptr, size: int = ...) -> None: ...
|
||||
def string(self, b, maxlen: int = -1): ...
|
||||
def buffer(self, bptr, size: int = -1) -> None: ...
|
||||
def sizeof(self, cdata_or_BType) -> int: ...
|
||||
def alignof(self, BType) -> int: ...
|
||||
def newp(self, BType, source): ...
|
||||
def cast(self, BType, source): ...
|
||||
def callback(self, BType, source, error, onerror): ...
|
||||
def gcp(self, cdata, destructor, size: int = ...): ...
|
||||
def gcp(self, cdata, destructor, size: int = 0): ...
|
||||
typeof: Incomplete
|
||||
def getcname(self, BType, replace_with): ...
|
||||
def typeoffsetof(self, BType, fieldname, num: int = ...): ...
|
||||
def rawaddressof(self, BTypePtr, cdata, offset: Incomplete | None = ...): ...
|
||||
def typeoffsetof(self, BType, fieldname, num: int = 0): ...
|
||||
def rawaddressof(self, BTypePtr, cdata, offset: Incomplete | None = None): ...
|
||||
|
||||
class CTypesLibrary:
|
||||
backend: Incomplete
|
||||
|
||||
@@ -7,7 +7,7 @@ class Parser:
|
||||
def __init__(self) -> None: ...
|
||||
def convert_pycparser_error(self, e, csource) -> None: ...
|
||||
def parse(
|
||||
self, csource, override: bool = ..., packed: bool = ..., pack: Incomplete | None = ..., dllexport: bool = ...
|
||||
self, csource, override: bool = False, packed: bool = False, pack: Incomplete | None = None, dllexport: bool = False
|
||||
) -> None: ...
|
||||
def parse_type(self, cdecl): ...
|
||||
def parse_type_and_quals(self, cdecl): ...
|
||||
|
||||
@@ -2,8 +2,8 @@ from _typeshed import Incomplete
|
||||
|
||||
LIST_OF_FILE_NAMES: Incomplete
|
||||
|
||||
def get_extension(srcfilename, modname, sources=..., **kwds): ...
|
||||
def compile(tmpdir, ext, compiler_verbose: int = ..., debug: Incomplete | None = ...): ...
|
||||
def get_extension(srcfilename, modname, sources=(), **kwds): ...
|
||||
def compile(tmpdir, ext, compiler_verbose: int = 0, debug: Incomplete | None = None): ...
|
||||
def maybe_relative_path(path): ...
|
||||
|
||||
int_or_long = int
|
||||
|
||||
@@ -13,10 +13,10 @@ def qualify(quals, replace_with): ...
|
||||
class BaseTypeByIdentity:
|
||||
is_array_type: bool
|
||||
is_raw_function: bool
|
||||
def get_c_name(self, replace_with: str = ..., context: str = ..., quals: int = ...): ...
|
||||
def get_c_name(self, replace_with: str = "", context: str = "a C file", quals: int = 0): ...
|
||||
def has_c_name(self): ...
|
||||
def is_integer_type(self): ...
|
||||
def get_cached_btype(self, ffi, finishlist, can_delay: bool = ...): ...
|
||||
def get_cached_btype(self, ffi, finishlist, can_delay: bool = False): ...
|
||||
|
||||
class BaseType(BaseTypeByIdentity):
|
||||
def __eq__(self, other): ...
|
||||
@@ -63,7 +63,7 @@ class BaseFunctionType(BaseType):
|
||||
ellipsis: Incomplete
|
||||
abi: Incomplete
|
||||
c_name_with_marker: Incomplete
|
||||
def __init__(self, args, result, ellipsis, abi: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, args, result, ellipsis, abi: Incomplete | None = None) -> None: ...
|
||||
|
||||
class RawFunctionType(BaseFunctionType):
|
||||
is_raw_function: bool
|
||||
@@ -78,7 +78,7 @@ class PointerType(BaseType):
|
||||
totype: Incomplete
|
||||
quals: Incomplete
|
||||
c_name_with_marker: Incomplete
|
||||
def __init__(self, totype, quals: int = ...) -> None: ...
|
||||
def __init__(self, totype, quals: int = 0) -> None: ...
|
||||
def build_backend_type(self, ffi, finishlist): ...
|
||||
|
||||
voidp_type: Incomplete
|
||||
@@ -90,7 +90,7 @@ const_voidp_type: Incomplete
|
||||
class NamedPointerType(PointerType):
|
||||
name: Incomplete
|
||||
c_name_with_marker: Incomplete
|
||||
def __init__(self, totype, name, quals: int = ...) -> None: ...
|
||||
def __init__(self, totype, name, quals: int = 0) -> None: ...
|
||||
|
||||
class ArrayType(BaseType):
|
||||
is_array_type: bool
|
||||
@@ -121,11 +121,11 @@ class StructOrUnion(StructOrUnionOrEnum):
|
||||
fldtypes: Incomplete
|
||||
fldbitsize: Incomplete
|
||||
fldquals: Incomplete
|
||||
def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals: Incomplete | None = None) -> None: ...
|
||||
def anonymous_struct_fields(self) -> Generator[Incomplete, None, None]: ...
|
||||
def enumfields(self, expand_anonymous_struct_union: bool = ...) -> Generator[Incomplete, None, None]: ...
|
||||
def enumfields(self, expand_anonymous_struct_union: bool = True) -> Generator[Incomplete, None, None]: ...
|
||||
def force_flatten(self) -> None: ...
|
||||
def get_cached_btype(self, ffi, finishlist, can_delay: bool = ...): ...
|
||||
def get_cached_btype(self, ffi, finishlist, can_delay: bool = False): ...
|
||||
def finish_backend_type(self, ffi, finishlist) -> None: ...
|
||||
def check_not_partial(self) -> None: ...
|
||||
def build_backend_type(self, ffi, finishlist): ...
|
||||
@@ -144,15 +144,15 @@ class EnumType(StructOrUnionOrEnum):
|
||||
enumerators: Incomplete
|
||||
enumvalues: Incomplete
|
||||
baseinttype: Incomplete
|
||||
def __init__(self, name, enumerators, enumvalues, baseinttype: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, name, enumerators, enumvalues, baseinttype: Incomplete | None = None) -> None: ...
|
||||
forcename: Incomplete
|
||||
def force_the_name(self, forcename) -> None: ...
|
||||
def check_not_partial(self) -> None: ...
|
||||
def build_backend_type(self, ffi, finishlist): ...
|
||||
def build_baseinttype(self, ffi, finishlist): ...
|
||||
|
||||
def unknown_type(name, structname: Incomplete | None = ...): ...
|
||||
def unknown_ptr_type(name, structname: Incomplete | None = ...): ...
|
||||
def unknown_type(name, structname: Incomplete | None = None): ...
|
||||
def unknown_ptr_type(name, structname: Incomplete | None = None): ...
|
||||
|
||||
global_lock: Incomplete
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
def merge_flags(cfg1, cfg2): ...
|
||||
def call(libname, flag, encoding=...): ...
|
||||
def call(libname, flag, encoding="utf-8"): ...
|
||||
def flags_from_pkgconfig(libs): ...
|
||||
|
||||
@@ -15,7 +15,7 @@ class GlobalExpr:
|
||||
type_op: Incomplete
|
||||
size: Incomplete
|
||||
check_value: Incomplete
|
||||
def __init__(self, name, address, type_op, size: int = ..., check_value: int = ...) -> None: ...
|
||||
def __init__(self, name, address, type_op, size: int = 0, check_value: int = 0) -> None: ...
|
||||
def as_c_expr(self): ...
|
||||
def as_python_expr(self): ...
|
||||
|
||||
@@ -64,7 +64,7 @@ class Recompiler:
|
||||
ffi: Incomplete
|
||||
module_name: Incomplete
|
||||
target_is_python: Incomplete
|
||||
def __init__(self, ffi, module_name, target_is_python: bool = ...) -> None: ...
|
||||
def __init__(self, ffi, module_name, target_is_python: bool = False) -> None: ...
|
||||
def needs_version(self, ver) -> None: ...
|
||||
cffi_types: Incomplete
|
||||
def collect_type_table(self): ...
|
||||
@@ -76,19 +76,19 @@ class Recompiler:
|
||||
|
||||
NativeIO: TypeAlias = io.StringIO
|
||||
|
||||
def make_c_source(ffi, module_name, preamble, target_c_file, verbose: bool = ...): ...
|
||||
def make_py_source(ffi, module_name, target_py_file, verbose: bool = ...): ...
|
||||
def make_c_source(ffi, module_name, preamble, target_c_file, verbose: bool = False): ...
|
||||
def make_py_source(ffi, module_name, target_py_file, verbose: bool = False): ...
|
||||
def recompile(
|
||||
ffi,
|
||||
module_name,
|
||||
preamble,
|
||||
tmpdir: str = ...,
|
||||
call_c_compiler: bool = ...,
|
||||
c_file: Incomplete | None = ...,
|
||||
source_extension: str = ...,
|
||||
extradir: Incomplete | None = ...,
|
||||
compiler_verbose: int = ...,
|
||||
target: Incomplete | None = ...,
|
||||
debug: Incomplete | None = ...,
|
||||
tmpdir: str = ".",
|
||||
call_c_compiler: bool = True,
|
||||
c_file: Incomplete | None = None,
|
||||
source_extension: str = ".c",
|
||||
extradir: Incomplete | None = None,
|
||||
compiler_verbose: int = 1,
|
||||
target: Incomplete | None = None,
|
||||
debug: Incomplete | None = None,
|
||||
**kwds,
|
||||
): ...
|
||||
|
||||
@@ -8,6 +8,6 @@ class VCPythonEngine:
|
||||
def find_module(self, module_name, path, so_suffixes): ...
|
||||
def collect_types(self) -> None: ...
|
||||
def write_source_to_f(self) -> None: ...
|
||||
def load_library(self, flags: Incomplete | None = ...): ...
|
||||
def load_library(self, flags: Incomplete | None = None): ...
|
||||
|
||||
cffimod_header: str
|
||||
|
||||
@@ -9,6 +9,6 @@ class VGenericEngine:
|
||||
def find_module(self, module_name, path, so_suffixes): ...
|
||||
def collect_types(self) -> None: ...
|
||||
def write_source_to_f(self) -> None: ...
|
||||
def load_library(self, flags: int = ...): ...
|
||||
def load_library(self, flags: int = 0): ...
|
||||
|
||||
cffimod_header: str
|
||||
|
||||
@@ -17,17 +17,17 @@ class Verifier:
|
||||
self,
|
||||
ffi,
|
||||
preamble,
|
||||
tmpdir: Incomplete | None = ...,
|
||||
modulename: Incomplete | None = ...,
|
||||
ext_package: Incomplete | None = ...,
|
||||
tag: str = ...,
|
||||
force_generic_engine: bool = ...,
|
||||
source_extension: str = ...,
|
||||
flags: Incomplete | None = ...,
|
||||
relative_to: Incomplete | None = ...,
|
||||
tmpdir: Incomplete | None = None,
|
||||
modulename: Incomplete | None = None,
|
||||
ext_package: Incomplete | None = None,
|
||||
tag: str = "",
|
||||
force_generic_engine: bool = False,
|
||||
source_extension: str = ".c",
|
||||
flags: Incomplete | None = None,
|
||||
relative_to: Incomplete | None = None,
|
||||
**kwds,
|
||||
) -> None: ...
|
||||
def write_source(self, file: Incomplete | None = ...) -> None: ...
|
||||
def write_source(self, file: Incomplete | None = None) -> None: ...
|
||||
def compile_module(self) -> None: ...
|
||||
def load_library(self): ...
|
||||
def get_module_name(self): ...
|
||||
@@ -36,4 +36,4 @@ class Verifier:
|
||||
def make_relative_to(self, kwds, relative_to): ...
|
||||
|
||||
def set_tmpdir(dirname) -> None: ...
|
||||
def cleanup_tmpdir(tmpdir: Incomplete | None = ..., keep_so: bool = ...) -> None: ...
|
||||
def cleanup_tmpdir(tmpdir: Incomplete | None = None, keep_so: bool = False) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user