stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -25,11 +25,11 @@ class CDLL:
def __init__(
self,
name: str | None,
mode: int = ...,
handle: int | None = ...,
use_errno: bool = ...,
use_last_error: bool = ...,
winmode: int | None = ...,
mode: int = 4,
handle: int | None = None,
use_errno: bool = False,
use_last_error: bool = False,
winmode: int | None = None,
) -> None: ...
else:
def __init__(
@@ -136,11 +136,11 @@ def byref(obj: _CData, offset: int = ...) -> _CArgObject: ...
_CastT = TypeVar("_CastT", bound=_CanCastTo)
def cast(obj: _CData | _CArgObject | int, typ: type[_CastT]) -> _CastT: ...
def create_string_buffer(init: int | bytes, size: int | None = ...) -> Array[c_char]: ...
def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_char]: ...
c_buffer = create_string_buffer
def create_unicode_buffer(init: int | str, size: int | None = ...) -> Array[c_wchar]: ...
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
@@ -178,12 +178,12 @@ if sys.platform == "win32":
def set_last_error(value: int) -> int: ...
def sizeof(obj_or_type: _CData | type[_CData]) -> int: ...
def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ...
def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ...
if sys.platform == "win32":
def WinError(code: int | None = ..., descr: str | None = ...) -> OSError: ...
def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ...
def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ...
class _SimpleCData(Generic[_T], _CData):
value: _T