mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
This commit is contained in:
parent
c68573b339
commit
a87c46eab3
52 changed files with 297 additions and 302 deletions
|
|
@ -404,13 +404,13 @@ _winapi_CloseHandle_impl(PyObject *module, HANDLE handle)
|
|||
_winapi.ConnectNamedPipe
|
||||
|
||||
handle: HANDLE
|
||||
overlapped as use_overlapped: bool(accept={int}) = False
|
||||
overlapped as use_overlapped: bool = False
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
|
||||
int use_overlapped)
|
||||
/*[clinic end generated code: output=335a0e7086800671 input=34f937c1c86e5e68]*/
|
||||
/*[clinic end generated code: output=335a0e7086800671 input=a80e56e8bd370e31]*/
|
||||
{
|
||||
BOOL success;
|
||||
OverlappedObject *overlapped = NULL;
|
||||
|
|
@ -1576,13 +1576,13 @@ _winapi.ReadFile
|
|||
|
||||
handle: HANDLE
|
||||
size: DWORD
|
||||
overlapped as use_overlapped: bool(accept={int}) = False
|
||||
overlapped as use_overlapped: bool = False
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size,
|
||||
int use_overlapped)
|
||||
/*[clinic end generated code: output=d3d5b44a8201b944 input=08c439d03a11aac5]*/
|
||||
/*[clinic end generated code: output=d3d5b44a8201b944 input=4f82f8e909ad91ad]*/
|
||||
{
|
||||
DWORD nread;
|
||||
PyObject *buf;
|
||||
|
|
@ -1862,13 +1862,13 @@ _winapi.WriteFile
|
|||
|
||||
handle: HANDLE
|
||||
buffer: object
|
||||
overlapped as use_overlapped: bool(accept={int}) = False
|
||||
overlapped as use_overlapped: bool = False
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer,
|
||||
int use_overlapped)
|
||||
/*[clinic end generated code: output=2ca80f6bf3fa92e3 input=11eae2a03aa32731]*/
|
||||
/*[clinic end generated code: output=2ca80f6bf3fa92e3 input=2badb008c8a2e2a0]*/
|
||||
{
|
||||
Py_buffer _buf, *buf;
|
||||
DWORD len, written;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue