[3.14] gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) (GH-150350) (GH-150473)

(cherry picked from commit cf73b17adf)
(cherry picked from commit 287c98f4cb)
This commit is contained in:
Serhiy Storchaka
2026-05-27 19:24:18 +03:00
committed by GitHub
parent 26c5468b5d
commit 49975a511f
71 changed files with 586 additions and 531 deletions
+4 -4
View File
@@ -911,14 +911,14 @@ _abc.get_cache_token
Returns the current ABC cache token.
The token is an opaque object (supporting equality testing) identifying the
current version of the ABC cache for virtual subclasses. The token changes
with every call to register() on any ABC.
The token is an opaque object (supporting equality testing) identifying
the current version of the ABC cache for virtual subclasses. The token
changes with every call to register() on any ABC.
[clinic start generated code]*/
static PyObject *
_abc_get_cache_token_impl(PyObject *module)
/*[clinic end generated code: output=c7d87841e033dacc input=70413d1c423ad9f9]*/
/*[clinic end generated code: output=c7d87841e033dacc input=d87acc04492f6bf3]*/
{
_abcmodule_state *state = get_abc_state(module);
return PyLong_FromUnsignedLongLong(get_invalidation_counter(state));
+13 -12
View File
@@ -966,12 +966,13 @@ Return the result this future represents.
If the future has been cancelled, raises CancelledError. If the
future's result isn't yet available, raises InvalidStateError. If
the future is done and has an exception set, this exception is raised.
the future is done and has an exception set, this exception is
raised.
[clinic start generated code]*/
static PyObject *
_asyncio_Future_result_impl(FutureObj *self)
/*[clinic end generated code: output=f35f940936a4b1e5 input=61d89f48e4c8b670]*/
/*[clinic end generated code: output=f35f940936a4b1e5 input=ee20e126776cbb04]*/
{
asyncio_state *state = get_asyncio_state_by_def((PyObject *)self);
PyObject *result;
@@ -1106,15 +1107,15 @@ _asyncio.Future.add_done_callback
Add a callback to be run when the future becomes done.
The callback is called with a single argument - the future object. If
the future is already done when this is called, the callback is
The callback is called with a single argument - the future object.
If the future is already done when this is called, the callback is
scheduled with call_soon.
[clinic start generated code]*/
static PyObject *
_asyncio_Future_add_done_callback_impl(FutureObj *self, PyTypeObject *cls,
PyObject *fn, PyObject *context)
/*[clinic end generated code: output=922e9a4cbd601167 input=37d97f941beb7b3e]*/
/*[clinic end generated code: output=922e9a4cbd601167 input=f4f6adb074cd3e0f]*/
{
asyncio_state *state = get_asyncio_state_by_cls(cls);
if (context == NULL) {
@@ -1263,15 +1264,15 @@ _asyncio.Future.cancel
Cancel the future and schedule callbacks.
If the future is already done or cancelled, return False. Otherwise,
change the future's state to cancelled, schedule the callbacks and
return True.
If the future is already done or cancelled, return False.
Otherwise, change the future's state to cancelled, schedule the
callbacks and return True.
[clinic start generated code]*/
static PyObject *
_asyncio_Future_cancel_impl(FutureObj *self, PyTypeObject *cls,
PyObject *msg)
/*[clinic end generated code: output=074956f35904b034 input=44ab4003da839970]*/
/*[clinic end generated code: output=074956f35904b034 input=0c9157547a964c4c]*/
{
asyncio_state *state = get_asyncio_state_by_cls(cls);
ENSURE_FUTURE_ALIVE(state, self)
@@ -1303,13 +1304,13 @@ _asyncio.Future.done
Return True if the future is done.
Done means either that a result / exception are available, or that the
future was cancelled.
Done means either that a result / exception are available, or that
the future was cancelled.
[clinic start generated code]*/
static PyObject *
_asyncio_Future_done_impl(FutureObj *self)
/*[clinic end generated code: output=244c5ac351145096 input=7204d3cc63bef7f3]*/
/*[clinic end generated code: output=244c5ac351145096 input=acf2c2347f3c01d8]*/
{
if (!future_is_alive(self) || self->fut_state == STATE_PENDING) {
Py_RETURN_FALSE;
+6 -6
View File
@@ -161,8 +161,8 @@ _bisect.bisect_right -> Py_ssize_t
Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x. So if x already appears in the list, a.insert(i, x) will
insert just after the rightmost x already there.
a[i:] have e > x. So if x already appears in the list, a.insert(i, x)
will insert just after the rightmost x already there.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
@@ -173,7 +173,7 @@ A custom key function can be supplied to customize the sort order.
static Py_ssize_t
_bisect_bisect_right_impl(PyObject *module, PyObject *a, PyObject *x,
Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
/*[clinic end generated code: output=3a4bc09cc7c8a73d input=43071869772dd53a]*/
/*[clinic end generated code: output=3a4bc09cc7c8a73d input=b8951a7bb11516e1]*/
{
return internal_bisect_right(a, x, lo, hi, key);
}
@@ -346,8 +346,8 @@ _bisect.bisect_left -> Py_ssize_t
Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e < x, and all e in
a[i:] have e >= x. So if x already appears in the list, a.insert(i, x) will
insert just before the leftmost x already there.
a[i:] have e >= x. So if x already appears in the list, a.insert(i, x)
will insert just before the leftmost x already there.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
@@ -358,7 +358,7 @@ A custom key function can be supplied to customize the sort order.
static Py_ssize_t
_bisect_bisect_left_impl(PyObject *module, PyObject *a, PyObject *x,
Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
/*[clinic end generated code: output=70749d6e5cae9284 input=f29c4fe7f9b797c7]*/
/*[clinic end generated code: output=70749d6e5cae9284 input=d24dc2b6439000f7]*/
{
return internal_bisect_left(a, x, lo, hi, key);
}
+12 -11
View File
@@ -606,24 +606,25 @@ _bz2.BZ2Decompressor.decompress
Decompress *data*, returning uncompressed data as bytes.
If *max_length* is nonnegative, returns at most *max_length* bytes of
decompressed data. If this limit is reached and further output can be
produced, *self.needs_input* will be set to ``False``. In this case, the next
call to *decompress()* may provide *data* as b'' to obtain more of the output.
If *max_length* is nonnegative, returns at most *max_length* bytes
of decompressed data. If this limit is reached and further output
can be produced, *self.needs_input* will be set to ``False``. In
this case, the next call to *decompress()* may provide *data* as b''
to obtain more of the output.
If all of the input data was decompressed and returned (either because this
was less than *max_length* bytes, or because *max_length* was negative),
*self.needs_input* will be set to True.
If all of the input data was decompressed and returned (either
because this was less than *max_length* bytes, or because
*max_length* was negative), *self.needs_input* will be set to True.
Attempting to decompress data after the end of stream is reached raises an
EOFError. Any data found after the end of the stream is ignored and saved in
the unused_data attribute.
Attempting to decompress data after the end of stream is reached
raises an EOFError. Any data found after the end of the stream is
ignored and saved in the unused_data attribute.
[clinic start generated code]*/
static PyObject *
_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
Py_ssize_t max_length)
/*[clinic end generated code: output=23e41045deb240a3 input=52e1ffc66a8ea624]*/
/*[clinic end generated code: output=23e41045deb240a3 input=7f68faa9ff7a1b51]*/
{
PyObject *result = NULL;
+22 -20
View File
@@ -55,14 +55,15 @@ _codecs.register
Register a codec search function.
Search functions are expected to take one argument, the encoding name in
all lower case letters, and either return None, or a tuple of functions
(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).
Search functions are expected to take one argument, the encoding
name in all lower case letters, and either return None, or a tuple
of functions (encoder, decoder, stream_reader, stream_writer) (or
a CodecInfo object).
[clinic start generated code]*/
static PyObject *
_codecs_register(PyObject *module, PyObject *search_function)
/*[clinic end generated code: output=d1bf21e99db7d6d3 input=369578467955cae4]*/
/*[clinic end generated code: output=d1bf21e99db7d6d3 input=2321d8c8c0420dfc]*/
{
if (PyCodec_Register(search_function))
return NULL;
@@ -115,16 +116,16 @@ _codecs.encode
Encodes obj using the codec registered for encoding.
The default encoding is 'utf-8'. errors may be given to set a
different error handling scheme. Default is 'strict' meaning that encoding
errors raise a ValueError. Other possible values are 'ignore', 'replace'
and 'backslashreplace' as well as any other name registered with
codecs.register_error that can handle ValueErrors.
different error handling scheme. Default is 'strict' meaning that
encoding errors raise a ValueError. Other possible values are 'ignore',
'replace' and 'backslashreplace' as well as any other name registered
with codecs.register_error that can handle ValueErrors.
[clinic start generated code]*/
static PyObject *
_codecs_encode_impl(PyObject *module, PyObject *obj, const char *encoding,
const char *errors)
/*[clinic end generated code: output=385148eb9a067c86 input=cd5b685040ff61f0]*/
/*[clinic end generated code: output=385148eb9a067c86 input=e5271d443e391d7f]*/
{
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
@@ -142,16 +143,16 @@ _codecs.decode
Decodes obj using the codec registered for encoding.
Default encoding is 'utf-8'. errors may be given to set a
different error handling scheme. Default is 'strict' meaning that encoding
errors raise a ValueError. Other possible values are 'ignore', 'replace'
and 'backslashreplace' as well as any other name registered with
codecs.register_error that can handle ValueErrors.
different error handling scheme. Default is 'strict' meaning that
encoding errors raise a ValueError. Other possible values are 'ignore',
'replace' and 'backslashreplace' as well as any other name registered
with codecs.register_error that can handle ValueErrors.
[clinic start generated code]*/
static PyObject *
_codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding,
const char *errors)
/*[clinic end generated code: output=679882417dc3a0bd input=7702c0cc2fa1add6]*/
/*[clinic end generated code: output=679882417dc3a0bd input=3e6254628f9ca538]*/
{
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
@@ -966,14 +967,15 @@ _codecs.register_error
Register the specified error handler under the name errors.
handler must be a callable object, that will be called with an exception
instance containing information about the location of the encoding/decoding
error and must return a (replacement, new position) tuple.
instance containing information about the location of the
encoding/decoding error and must return a (replacement, new position)
tuple.
[clinic start generated code]*/
static PyObject *
_codecs_register_error_impl(PyObject *module, const char *errors,
PyObject *handler)
/*[clinic end generated code: output=fa2f7d1879b3067d input=5e6709203c2e33fe]*/
/*[clinic end generated code: output=fa2f7d1879b3067d input=5bea01dfe835d9d8]*/
{
if (PyCodec_RegisterError(errors, handler))
return NULL;
@@ -1011,13 +1013,13 @@ _codecs.lookup_error
lookup_error(errors) -> handler
Return the error handler for the specified error handling name or raise a
LookupError, if no handler exists under this name.
Return the error handler for the specified error handling name or raise
a LookupError, if no handler exists under this name.
[clinic start generated code]*/
static PyObject *
_codecs_lookup_error_impl(PyObject *module, const char *name)
/*[clinic end generated code: output=087f05dc0c9a98cc input=4775dd65e6235aba]*/
/*[clinic end generated code: output=087f05dc0c9a98cc input=86cfb6a7a9c67113]*/
{
return PyCodec_LookupError(name);
}
+3 -3
View File
@@ -3302,13 +3302,13 @@ datetime.date.fromtimestamp
Create a date from a POSIX timestamp.
The timestamp is a number, e.g. created via time.time(), that is interpreted
as local time.
The timestamp is a number, e.g. created via time.time(), that is
interpreted as local time.
[clinic start generated code]*/
static PyObject *
datetime_date_fromtimestamp_impl(PyTypeObject *type, PyObject *timestamp)
/*[clinic end generated code: output=59def4e32c028fb6 input=eabb3fe7f40491fe]*/
/*[clinic end generated code: output=59def4e32c028fb6 input=15720eef43b169a1]*/
{
return date_fromtimestamp((PyObject *) type, timestamp);
}
+3 -2
View File
@@ -436,13 +436,14 @@ _dbm.dbm.setdefault
Return the value for key if present, otherwise default.
If key is not in the database, it is inserted with default as the value.
If key is not in the database, it is inserted with default as the
value.
[clinic start generated code]*/
static PyObject *
_dbm_dbm_setdefault_impl(dbmobject *self, PyTypeObject *cls, const char *key,
Py_ssize_t key_length, PyObject *default_value)
/*[clinic end generated code: output=9c2f6ea6d0fb576c input=c01510ef7571e13b]*/
/*[clinic end generated code: output=9c2f6ea6d0fb576c input=81224965c110f830]*/
{
datum dbm_key, val;
Py_ssize_t tmp_size;
+4 -4
View File
@@ -979,9 +979,9 @@ _functools.reduce
Apply a function of two arguments cumulatively to the items of an iterable, from left to right.
This effectively reduces the iterable to a single value. If initial is present,
it is placed before the items of the iterable in the calculation, and serves as
a default when the iterable is empty.
This effectively reduces the iterable to a single value. If initial is
present, it is placed before the items of the iterable in the
calculation, and serves as a default when the iterable is empty.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])
calculates ((((1 + 2) + 3) + 4) + 5).
@@ -990,7 +990,7 @@ calculates ((((1 + 2) + 3) + 4) + 5).
static PyObject *
_functools_reduce_impl(PyObject *module, PyObject *func, PyObject *seq,
PyObject *result)
/*[clinic end generated code: output=30d898fe1267c79d input=1511e9a8c38581ac]*/
/*[clinic end generated code: output=30d898fe1267c79d input=1e2c850f5229ff2a]*/
{
PyObject *args, *it;
+11 -11
View File
@@ -525,14 +525,14 @@ _gdbm.gdbm.firstkey
Return the starting key for the traversal.
It's possible to loop over every key in the database using this method
and the nextkey() method. The traversal is ordered by GDBM's internal
hash values, and won't be sorted by the key values.
It's possible to loop over every key in the database using this
method and the nextkey() method. The traversal is ordered by GDBM's
internal hash values, and won't be sorted by the key values.
[clinic start generated code]*/
static PyObject *
_gdbm_gdbm_firstkey_impl(gdbmobject *self, PyTypeObject *cls)
/*[clinic end generated code: output=139275e9c8b60827 input=aad5a7c886c542f5]*/
/*[clinic end generated code: output=139275e9c8b60827 input=ba40f0d81eae0f35]*/
{
PyObject *v;
datum key;
@@ -561,8 +561,8 @@ _gdbm.gdbm.nextkey
Returns the key that follows key in the traversal.
The following code prints every key in the database db, without having
to create a list in memory that contains them all:
The following code prints every key in the database db, without
having to create a list in memory that contains them all:
k = db.firstkey()
while k is not None:
@@ -573,7 +573,7 @@ to create a list in memory that contains them all:
static PyObject *
_gdbm_gdbm_nextkey_impl(gdbmobject *self, PyTypeObject *cls, const char *key,
Py_ssize_t key_length)
/*[clinic end generated code: output=c81a69300ef41766 input=181f1130d5bfeb1e]*/
/*[clinic end generated code: output=c81a69300ef41766 input=78293a913b02387e]*/
{
PyObject *v;
datum dbm_key, nextkey;
@@ -604,14 +604,14 @@ Reorganize the database.
If you have carried out a lot of deletions and would like to shrink
the space used by the GDBM file, this routine will reorganize the
database. GDBM will not shorten the length of a database file except
by using this reorganization; otherwise, deleted file space will be
kept and reused as new (key,value) pairs are added.
database. GDBM will not shorten the length of a database file
except by using this reorganization; otherwise, deleted file space
will be kept and reused as new (key,value) pairs are added.
[clinic start generated code]*/
static PyObject *
_gdbm_gdbm_reorganize_impl(gdbmobject *self, PyTypeObject *cls)
/*[clinic end generated code: output=d77c69e8e3dd644a input=3e3ca0d2ea787861]*/
/*[clinic end generated code: output=d77c69e8e3dd644a input=d7fcf03051c6f7cd]*/
{
_gdbm_state *state = PyType_GetModuleState(cls);
assert(state != NULL);
+6 -6
View File
@@ -1834,13 +1834,13 @@ _hashlib.HMAC.hexdigest
Return hexadecimal digest of the bytes passed to the update() method so far.
This may be used to exchange the value safely in email or other non-binary
environments.
This may be used to exchange the value safely in email or other
non-binary environments.
[clinic start generated code]*/
static PyObject *
_hashlib_HMAC_hexdigest_impl(HMACobject *self)
/*[clinic end generated code: output=80d825be1eaae6a7 input=5abc42702874ddcf]*/
/*[clinic end generated code: output=80d825be1eaae6a7 input=865e6128c7ec0781]*/
{
unsigned char digest[EVP_MAX_MD_SIZE];
unsigned int digest_size = _hashlib_hmac_digest_size(self);
@@ -2005,8 +2005,8 @@ _hashlib.get_fips_mode -> int
Determine the OpenSSL FIPS mode of operation.
For OpenSSL 3.0.0 and newer it returns the state of the default provider
in the default OSSL context. It's not quite the same as FIPS_mode() but good
enough for unittests.
in the default OSSL context. It's not quite the same as FIPS_mode() but
good enough for unittests.
Effectively any non-zero return value indicates FIPS mode;
values other than 1 may have additional significance.
@@ -2014,7 +2014,7 @@ values other than 1 may have additional significance.
static int
_hashlib_get_fips_mode_impl(PyObject *module)
/*[clinic end generated code: output=87eece1bab4d3fa9 input=2db61538c41c6fef]*/
/*[clinic end generated code: output=87eece1bab4d3fa9 input=a6cdb6901421d122]*/
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+3 -3
View File
@@ -593,13 +593,13 @@ _heapq.heappushpop_max
Maxheap variant of heappushpop.
The combined action runs more efficiently than heappush_max() followed by
a separate call to heappop_max().
The combined action runs more efficiently than heappush_max()
followed by a separate call to heappop_max().
[clinic start generated code]*/
static PyObject *
_heapq_heappushpop_max_impl(PyObject *module, PyObject *heap, PyObject *item)
/*[clinic end generated code: output=ff0019f0941aca0d input=24d0defa6fd6df4a]*/
/*[clinic end generated code: output=ff0019f0941aca0d input=52030929667a4c08]*/
{
PyObject *returnitem;
int cmp;
+12 -11
View File
@@ -1133,24 +1133,25 @@ _lzma.LZMADecompressor.decompress
Decompress *data*, returning uncompressed data as bytes.
If *max_length* is nonnegative, returns at most *max_length* bytes of
decompressed data. If this limit is reached and further output can be
produced, *self.needs_input* will be set to ``False``. In this case, the next
call to *decompress()* may provide *data* as b'' to obtain more of the output.
If *max_length* is nonnegative, returns at most *max_length* bytes
of decompressed data. If this limit is reached and further output
can be produced, *self.needs_input* will be set to ``False``. In
this case, the next call to *decompress()* may provide *data* as b''
to obtain more of the output.
If all of the input data was decompressed and returned (either because this
was less than *max_length* bytes, or because *max_length* was negative),
*self.needs_input* will be set to True.
If all of the input data was decompressed and returned (either
because this was less than *max_length* bytes, or because
*max_length* was negative), *self.needs_input* will be set to True.
Attempting to decompress data after the end of stream is reached raises an
EOFError. Any data found after the end of the stream is ignored and saved in
the unused_data attribute.
Attempting to decompress data after the end of stream is reached
raises an EOFError. Any data found after the end of the stream is
ignored and saved in the unused_data attribute.
[clinic start generated code]*/
static PyObject *
_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
Py_ssize_t max_length)
/*[clinic end generated code: output=ef4e20ec7122241d input=60c1f135820e309d]*/
/*[clinic end generated code: output=ef4e20ec7122241d input=0eb62669c4315dee]*/
{
PyObject *result = NULL;
+4 -4
View File
@@ -50,9 +50,9 @@ PyDoc_STRVAR(_posixshmem_shm_unlink__doc__,
"\n"
"Remove a shared memory object (similar to unlink()).\n"
"\n"
"Remove a shared memory object name, and, once all processes have unmapped\n"
"the object, de-allocates and destroys the contents of the associated memory\n"
"region.");
"Remove a shared memory object name, and, once all processes have\n"
"unmapped the object, de-allocates and destroys the contents of the\n"
"associated memory region.");
#define _POSIXSHMEM_SHM_UNLINK_METHODDEF \
{"shm_unlink", (PyCFunction)_posixshmem_shm_unlink, METH_O, _posixshmem_shm_unlink__doc__},
@@ -86,4 +86,4 @@ exit:
#ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
#define _POSIXSHMEM_SHM_UNLINK_METHODDEF
#endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
/*[clinic end generated code: output=74588a5abba6e36c input=a9049054013a1b77]*/
/*[clinic end generated code: output=e69afacce7b0595e input=a9049054013a1b77]*/
+4 -4
View File
@@ -81,15 +81,15 @@ _posixshmem.shm_unlink
Remove a shared memory object (similar to unlink()).
Remove a shared memory object name, and, once all processes have unmapped
the object, de-allocates and destroys the contents of the associated memory
region.
Remove a shared memory object name, and, once all processes have
unmapped the object, de-allocates and destroys the contents of the
associated memory region.
[clinic start generated code]*/
static PyObject *
_posixshmem_shm_unlink_impl(PyObject *module, PyObject *path)
/*[clinic end generated code: output=42f8b23d134b9ff5 input=298369d013dcad63]*/
/*[clinic end generated code: output=42f8b23d134b9ff5 input=cf7a30ec6503cf78]*/
{
int rv;
int async_err = 0;
+1 -2
View File
@@ -119,7 +119,6 @@ _opcode_has_const_impl(PyObject *module, int opcode)
}
/*[clinic input]
_opcode.has_name -> bool
opcode: int
@@ -129,7 +128,7 @@ Return True if the opcode accesses an attribute by name, False otherwise.
static int
_opcode_has_name_impl(PyObject *module, int opcode)
/*[clinic end generated code: output=b49a83555c2fa517 input=448aa5e4bcc947ba]*/
/*[clinic end generated code: output=b49a83555c2fa517 input=3032469628dd0849]*/
{
return IS_VALID_OPCODE(opcode) && OPCODE_HAS_NAME(opcode);
}
+8 -8
View File
@@ -989,15 +989,15 @@ _posixsubprocess.fork_exec as subprocess_fork_exec
Spawn a fresh new child process.
Fork a child process, close parent file descriptors as appropriate in the
child and duplicate the few that are needed before calling exec() in the
child process.
Fork a child process, close parent file descriptors as appropriate in
the child and duplicate the few that are needed before calling exec() in
the child process.
If close_fds is True, close file descriptors 3 and higher, except those listed
in the sorted tuple pass_fds.
If close_fds is True, close file descriptors 3 and higher, except those
listed in the sorted tuple pass_fds.
The preexec_fn, if supplied, will be called immediately before closing file
descriptors and exec.
The preexec_fn, if supplied, will be called immediately before closing
file descriptors and exec.
WARNING: preexec_fn is NOT SAFE if your application uses threads.
It may trigger infrequent, difficult to debug deadlocks.
@@ -1022,7 +1022,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
PyObject *extra_groups_packed,
PyObject *uid_object, int child_umask,
PyObject *preexec_fn)
/*[clinic end generated code: output=288464dc56e373c7 input=f311c3bcb5dd55c8]*/
/*[clinic end generated code: output=288464dc56e373c7 input=5e56eac3e036e349]*/
{
PyObject *converted_args = NULL, *fast_args = NULL;
PyObject *preexec_fn_args_tuple = NULL;
+10 -8
View File
@@ -297,15 +297,16 @@ _queue.SimpleQueue.put
Put the item on the queue.
The optional 'block' and 'timeout' arguments are ignored, as this method
never blocks. They are provided for compatibility with the Queue class.
The optional 'block' and 'timeout' arguments are ignored, as this
method never blocks. They are provided for compatibility with the
Queue class.
[clinic start generated code]*/
static PyObject *
_queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item,
int block, PyObject *timeout)
/*[clinic end generated code: output=4333136e88f90d8b input=a16dbb33363c0fa8]*/
/*[clinic end generated code: output=4333136e88f90d8b input=9f9ff270a74670c3]*/
{
HandoffData data = {
.handed_off = 0,
@@ -365,10 +366,11 @@ _queue.SimpleQueue.get
Remove and return an item from the queue.
If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until an item is available. If 'timeout' is
a non-negative number, it blocks at most 'timeout' seconds and raises
the Empty exception if no item was available within that time.
If optional args 'block' is true and 'timeout' is None (the
default), block if necessary until an item is available. If
'timeout' is a non-negative number, it blocks at most 'timeout'
seconds and raises the Empty exception if no item was available
within that time.
Otherwise ('block' is false), return an item if one is immediately
available, else raise the Empty exception ('timeout' is ignored
in that case).
@@ -378,7 +380,7 @@ in that case).
static PyObject *
_queue_SimpleQueue_get_impl(simplequeueobject *self, PyTypeObject *cls,
int block, PyObject *timeout_obj)
/*[clinic end generated code: output=5c2cca914cd1e55b input=f7836c65e5839c51]*/
/*[clinic end generated code: output=5c2cca914cd1e55b input=afa0889bbc6b4761]*/
{
PyTime_t endtime = 0;
+32 -29
View File
@@ -2223,14 +2223,15 @@ _ssl._SSLSocket.context
This changes the context associated with the SSLSocket.
This is typically used from within a callback function set by the sni_callback
on the SSLContext to change the certificate information associated with the
SSLSocket before the cryptographic exchange handshake messages.
This is typically used from within a callback function set by the
sni_callback on the SSLContext to change the certificate information
associated with the SSLSocket before the cryptographic exchange
handshake messages.
[clinic start generated code]*/
static PyObject *
_ssl__SSLSocket_context_get_impl(PySSLSocket *self)
/*[clinic end generated code: output=d23e82f72f32e3d7 input=7cbb97407c2ace30]*/
/*[clinic end generated code: output=d23e82f72f32e3d7 input=b845dea1f9710ebe]*/
{
return Py_NewRef(self->ctx);
}
@@ -2861,15 +2862,16 @@ _ssl._SSLSocket.get_channel_binding
Get channel binding data for current connection.
Raise ValueError if the requested `cb_type` is not supported. Return bytes
of the data or None if the data is not available (e.g. before the handshake).
Raise ValueError if the requested `cb_type` is not supported.
Return bytes of the data or None if the data is not available (e.g.
before the handshake).
Only 'tls-unique' channel binding data from RFC 5929 is supported.
[clinic start generated code]*/
static PyObject *
_ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self,
const char *cb_type)
/*[clinic end generated code: output=34bac9acb6a61d31 input=e008004fc08744db]*/
/*[clinic end generated code: output=34bac9acb6a61d31 input=bed81ef7936535a0]*/
{
char buf[PySSL_CB_MAXLEN];
size_t len;
@@ -4787,15 +4789,16 @@ _ssl._SSLContext.sni_callback
Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.
If the argument is None then the callback is disabled. The method is called
with the SSLSocket, the server name as a string, and the SSLContext object.
If the argument is None then the callback is disabled. The method
is called with the SSLSocket, the server name as a string, and the
SSLContext object.
See RFC 6066 for details of the SNI extension.
[clinic start generated code]*/
static PyObject *
_ssl__SSLContext_sni_callback_get_impl(PySSLContext *self)
/*[clinic end generated code: output=961e6575cdfaf036 input=9b2473c5e984cfe6]*/
/*[clinic end generated code: output=961e6575cdfaf036 input=280120c01d089dc3]*/
{
PyObject *cb = self->set_sni_cb;
if (cb == NULL) {
@@ -4885,16 +4888,16 @@ _ssl._SSLContext.cert_store_stats
Returns quantities of loaded X.509 certificates.
X.509 certificates with a CA extension and certificate revocation lists
inside the context's cert store.
X.509 certificates with a CA extension and certificate revocation
lists inside the context's cert store.
NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.
NOTE: Certificates in a capath directory aren't loaded unless they
have been used at least once.
[clinic start generated code]*/
static PyObject *
_ssl__SSLContext_cert_store_stats_impl(PySSLContext *self)
/*[clinic end generated code: output=5f356f4d9cca874d input=d13c6e3f2b48539b]*/
/*[clinic end generated code: output=5f356f4d9cca874d input=9e5094e094b892a3]*/
{
X509_STORE *store;
STACK_OF(X509_OBJECT) *objs;
@@ -4937,16 +4940,16 @@ _ssl._SSLContext.get_ca_certs
Returns a list of dicts with information of loaded CA certs.
If the optional argument is True, returns a DER-encoded copy of the CA
certificate.
If the optional argument is True, returns a DER-encoded copy of the
CA certificate.
NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.
NOTE: Certificates in a capath directory aren't loaded unless they
have been used at least once.
[clinic start generated code]*/
static PyObject *
_ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form)
/*[clinic end generated code: output=0d58f148f37e2938 input=eb0592909c9ad6e7]*/
/*[clinic end generated code: output=0d58f148f37e2938 input=9f71af5aa4e67076]*/
{
X509_STORE *store;
STACK_OF(X509_OBJECT) *objs;
@@ -5840,13 +5843,13 @@ _ssl.RAND_status
Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.
It is necessary to seed the PRNG with RAND_add() on some platforms before
using the ssl() function.
It is necessary to seed the PRNG with RAND_add() on some platforms
before using the ssl() function.
[clinic start generated code]*/
static PyObject *
_ssl_RAND_status_impl(PyObject *module)
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=636fb5659ea2e727]*/
/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=844b0dc0f2165e87]*/
{
return PyBool_FromLong(RAND_status());
}
@@ -6108,16 +6111,16 @@ _ssl.enum_certificates
Retrieve certificates from Windows' cert store.
store_name may be one of 'CA', 'ROOT' or 'MY'. The system may provide
more cert storages, too. The function returns a list of (bytes,
encoding_type, trust) tuples. The encoding_type flag can be interpreted
with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The trust setting is either
a set of OIDs or the boolean True.
store_name may be one of 'CA', 'ROOT' or 'MY'. The system may
provide more cert storages, too. The function returns a list of
(bytes, encoding_type, trust) tuples. The encoding_type flag can be
interpreted with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The
trust setting is either a set of OIDs or the boolean True.
[clinic start generated code]*/
static PyObject *
_ssl_enum_certificates_impl(PyObject *module, const char *store_name)
/*[clinic end generated code: output=5134dc8bb3a3c893 input=263c22e6c6988cf3]*/
/*[clinic end generated code: output=5134dc8bb3a3c893 input=ef81b4bd1b7ab8e9]*/
{
HCERTSTORE hCollectionStore = NULL;
PCCERT_CONTEXT pCertCtx = NULL;
+3 -3
View File
@@ -84,8 +84,8 @@ PyDoc_STRVAR(_testlimitedcapi_test_long_as_size_t__doc__,
"\n"
"Test the PyLong_As{Size,Ssize}_t API.\n"
"\n"
"At present this just tests that non-integer arguments are handled correctly.\n"
"It should be extended to test overflow handling.");
"At present this just tests that non-integer arguments are handled\n"
"correctly. It should be extended to test overflow handling.");
#define _TESTLIMITEDCAPI_TEST_LONG_AS_SIZE_T_METHODDEF \
{"test_long_as_size_t", (PyCFunction)_testlimitedcapi_test_long_as_size_t, METH_NOARGS, _testlimitedcapi_test_long_as_size_t__doc__},
@@ -140,4 +140,4 @@ PyDoc_STRVAR(_testlimitedcapi_PyLong_AsInt__doc__,
#define _TESTLIMITEDCAPI_PYLONG_ASINT_METHODDEF \
{"PyLong_AsInt", (PyCFunction)_testlimitedcapi_PyLong_AsInt, METH_O, _testlimitedcapi_PyLong_AsInt__doc__},
/*[clinic end generated code: output=bc52b73c599f96c2 input=a9049054013a1b77]*/
/*[clinic end generated code: output=fb5c95bd0a4bdad8 input=a9049054013a1b77]*/
+3 -3
View File
@@ -451,13 +451,13 @@ _testlimitedcapi.test_long_as_size_t
Test the PyLong_As{Size,Ssize}_t API.
At present this just tests that non-integer arguments are handled correctly.
It should be extended to test overflow handling.
At present this just tests that non-integer arguments are handled
correctly. It should be extended to test overflow handling.
[clinic start generated code]*/
static PyObject *
_testlimitedcapi_test_long_as_size_t_impl(PyObject *module)
/*[clinic end generated code: output=297a9f14a42f55af input=8923d8f2038c46f4]*/
/*[clinic end generated code: output=297a9f14a42f55af input=692e73744b35bf6e]*/
{
size_t out_u;
Py_ssize_t out_s;
+3 -3
View File
@@ -141,14 +141,14 @@ _testmultiphase.StateAccessType.get_defining_module
Return the module of the defining class.
Also tests that result of PyType_GetModuleByDef matches defining_class's
module.
Also tests that result of PyType_GetModuleByDef matches
defining_class's module.
[clinic start generated code]*/
static PyObject *
_testmultiphase_StateAccessType_get_defining_module_impl(StateAccessTypeObject *self,
PyTypeObject *cls)
/*[clinic end generated code: output=ba2a14284a5d0921 input=d2c7245c8a9d06f8]*/
/*[clinic end generated code: output=ba2a14284a5d0921 input=903e7f66555d65ae]*/
{
PyObject *retval;
retval = PyType_GetModule(cls);
+3 -2
View File
@@ -3247,12 +3247,13 @@ _tkinter.setbusywaitinterval
Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.
It should be set to a divisor of the maximum time between frames in an animation.
It should be set to a divisor of the maximum time between frames in
an animation.
[clinic start generated code]*/
static PyObject *
_tkinter_setbusywaitinterval_impl(PyObject *module, int new_val)
/*[clinic end generated code: output=42bf7757dc2d0ab6 input=deca1d6f9e6dae47]*/
/*[clinic end generated code: output=42bf7757dc2d0ab6 input=984bbb86a3f916b7]*/
{
if (new_val < 0) {
PyErr_SetString(PyExc_ValueError,
+15 -14
View File
@@ -1441,13 +1441,13 @@ array.array.buffer_info
Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.
The length should be multiplied by the itemsize attribute to calculate
the buffer length in bytes.
The length should be multiplied by the itemsize attribute to
calculate the buffer length in bytes.
[clinic start generated code]*/
static PyObject *
array_array_buffer_info_impl(arrayobject *self)
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=a58bae5c6e1ac6a6]*/
/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=f4d34398d5dfc856]*/
{
PyObject *retval = NULL, *v;
@@ -1493,13 +1493,13 @@ array.array.byteswap
Byteswap all items of the array.
If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is
raised.
If the items in the array are not 1, 2, 4, or 8 bytes in size,
RuntimeError is raised.
[clinic start generated code]*/
static PyObject *
array_array_byteswap_impl(arrayobject *self)
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=6a85591b950a0186]*/
/*[clinic end generated code: output=5f8236cbdf0d90b5 input=3005a63cc263b839]*/
{
char *p;
Py_ssize_t i;
@@ -1843,14 +1843,14 @@ array.array.fromunicode
Extends this array with data from the unicode string ustr.
The array must be a unicode type array; otherwise a ValueError is raised.
Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of
some other type.
The array must be a unicode type array; otherwise a ValueError is
raised. Use array.frombytes(ustr.encode(...)) to append Unicode
data to an array of some other type.
[clinic start generated code]*/
static PyObject *
array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
/*[clinic end generated code: output=24359f5e001a7f2b input=025db1fdade7a4ce]*/
/*[clinic end generated code: output=24359f5e001a7f2b input=01fa592ec7b948b6]*/
{
int typecode = self->ob_descr->typecode;
if (typecode != 'u' && typecode != 'w') {
@@ -1902,14 +1902,15 @@ array.array.tounicode
Extends this array with data from the unicode string ustr.
Convert the array to a unicode string. The array must be a unicode type array;
otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a
unicode string from an array of some other type.
Convert the array to a unicode string. The array must be a unicode
type array; otherwise a ValueError is raised. Use
array.tobytes().decode() to obtain a unicode string from an array of
some other type.
[clinic start generated code]*/
static PyObject *
array_array_tounicode_impl(arrayobject *self)
/*[clinic end generated code: output=08e442378336e1ef input=127242eebe70b66d]*/
/*[clinic end generated code: output=08e442378336e1ef input=d4d5f398aa71a2be]*/
{
int typecode = self->ob_descr->typecode;
if (typecode != 'u' && typecode != 'w') {
+10 -8
View File
@@ -14,10 +14,11 @@ PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__,
"\n"
"Return an encoded string version of \'input\'.\n"
"\n"
"\'errors\' may be given to set a different error handling scheme. Default is\n"
"\'strict\' meaning that encoding errors raise a UnicodeEncodeError. Other possible\n"
"values are \'ignore\', \'replace\' and \'xmlcharrefreplace\' as well as any other name\n"
"registered with codecs.register_error that can handle UnicodeEncodeErrors.");
"\'errors\' may be given to set a different error handling scheme.\n"
"Default is \'strict\' meaning that encoding errors raise\n"
"a UnicodeEncodeError. Other possible values are \'ignore\', \'replace\'\n"
"and \'xmlcharrefreplace\' as well as any other name registered with\n"
"codecs.register_error that can handle UnicodeEncodeErrors.");
#define _MULTIBYTECODEC_MULTIBYTECODEC_ENCODE_METHODDEF \
{"encode", _PyCFunction_CAST(_multibytecodec_MultibyteCodec_encode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__},
@@ -103,9 +104,10 @@ PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
"\n"
"Decodes \'input\'.\n"
"\n"
"\'errors\' may be given to set a different error handling scheme. Default is\n"
"\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
"values are \'ignore\' and \'replace\' as well as any other name registered with\n"
"\'errors\' may be given to set a different error handling scheme.\n"
"Default is \'strict\' meaning that encoding errors raise\n"
"a UnicodeDecodeError. Other possible values are \'ignore\' and\n"
"\'replace\' as well as any other name registered with\n"
"codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
#define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \
@@ -696,4 +698,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
/*[clinic end generated code: output=014f4f6bb9d29594 input=a9049054013a1b77]*/
/*[clinic end generated code: output=a84b1544d7d01abb input=a9049054013a1b77]*/
+11 -9
View File
@@ -597,17 +597,18 @@ _multibytecodec.MultibyteCodec.encode
Return an encoded string version of 'input'.
'errors' may be given to set a different error handling scheme. Default is
'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible
values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name
registered with codecs.register_error that can handle UnicodeEncodeErrors.
'errors' may be given to set a different error handling scheme.
Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace'
and 'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
[clinic start generated code]*/
static PyObject *
_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
PyObject *input,
const char *errors)
/*[clinic end generated code: output=7b26652045ba56a9 input=2841745b95ed338f]*/
/*[clinic end generated code: output=7b26652045ba56a9 input=980002ed1447697b]*/
{
MultibyteCodec_State state;
PyObject *errorcb, *r, *ucvt;
@@ -662,9 +663,10 @@ _multibytecodec.MultibyteCodec.decode
Decodes 'input'.
'errors' may be given to set a different error handling scheme. Default is
'strict' meaning that encoding errors raise a UnicodeDecodeError. Other possible
values are 'ignore' and 'replace' as well as any other name registered with
'errors' may be given to set a different error handling scheme.
Default is 'strict' meaning that encoding errors raise
a UnicodeDecodeError. Other possible values are 'ignore' and
'replace' as well as any other name registered with
codecs.register_error that is able to handle UnicodeDecodeErrors."
[clinic start generated code]*/
@@ -672,7 +674,7 @@ static PyObject *
_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
Py_buffer *input,
const char *errors)
/*[clinic end generated code: output=ff419f65bad6cc77 input=e0c78fc7ab190def]*/
/*[clinic end generated code: output=ff419f65bad6cc77 input=dbf93d8bb98ca440]*/
{
MultibyteCodec_State state;
MultibyteDecodeBuffer buf;
+4 -4
View File
@@ -146,9 +146,9 @@ PyDoc_STRVAR(_abc_get_cache_token__doc__,
"\n"
"Returns the current ABC cache token.\n"
"\n"
"The token is an opaque object (supporting equality testing) identifying the\n"
"current version of the ABC cache for virtual subclasses. The token changes\n"
"with every call to register() on any ABC.");
"The token is an opaque object (supporting equality testing) identifying\n"
"the current version of the ABC cache for virtual subclasses. The token\n"
"changes with every call to register() on any ABC.");
#define _ABC_GET_CACHE_TOKEN_METHODDEF \
{"get_cache_token", (PyCFunction)_abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__},
@@ -161,4 +161,4 @@ _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return _abc_get_cache_token_impl(module);
}
/*[clinic end generated code: output=1989b6716c950e17 input=a9049054013a1b77]*/
/*[clinic end generated code: output=b05d599656aeb1e1 input=a9049054013a1b77]*/
+10 -9
View File
@@ -90,7 +90,8 @@ PyDoc_STRVAR(_asyncio_Future_result__doc__,
"\n"
"If the future has been cancelled, raises CancelledError. If the\n"
"future\'s result isn\'t yet available, raises InvalidStateError. If\n"
"the future is done and has an exception set, this exception is raised.");
"the future is done and has an exception set, this exception is\n"
"raised.");
#define _ASYNCIO_FUTURE_RESULT_METHODDEF \
{"result", (PyCFunction)_asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__},
@@ -250,8 +251,8 @@ PyDoc_STRVAR(_asyncio_Future_add_done_callback__doc__,
"\n"
"Add a callback to be run when the future becomes done.\n"
"\n"
"The callback is called with a single argument - the future object. If\n"
"the future is already done when this is called, the callback is\n"
"The callback is called with a single argument - the future object.\n"
"If the future is already done when this is called, the callback is\n"
"scheduled with call_soon.");
#define _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF \
@@ -371,9 +372,9 @@ PyDoc_STRVAR(_asyncio_Future_cancel__doc__,
"\n"
"Cancel the future and schedule callbacks.\n"
"\n"
"If the future is already done or cancelled, return False. Otherwise,\n"
"change the future\'s state to cancelled, schedule the callbacks and\n"
"return True.");
"If the future is already done or cancelled, return False.\n"
"Otherwise, change the future\'s state to cancelled, schedule the\n"
"callbacks and return True.");
#define _ASYNCIO_FUTURE_CANCEL_METHODDEF \
{"cancel", _PyCFunction_CAST(_asyncio_Future_cancel), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_cancel__doc__},
@@ -465,8 +466,8 @@ PyDoc_STRVAR(_asyncio_Future_done__doc__,
"\n"
"Return True if the future is done.\n"
"\n"
"Done means either that a result / exception are available, or that the\n"
"future was cancelled.");
"Done means either that a result / exception are available, or that\n"
"the future was cancelled.");
#define _ASYNCIO_FUTURE_DONE_METHODDEF \
{"done", (PyCFunction)_asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__},
@@ -2232,4 +2233,4 @@ _asyncio_future_discard_from_awaited_by(PyObject *module, PyObject *const *args,
exit:
return return_value;
}
/*[clinic end generated code: output=b69948ed810591d9 input=a9049054013a1b77]*/
/*[clinic end generated code: output=32996fb47c48245b input=a9049054013a1b77]*/
+5 -5
View File
@@ -16,8 +16,8 @@ PyDoc_STRVAR(_bisect_bisect_right__doc__,
"Return the index where to insert item x in list a, assuming a is sorted.\n"
"\n"
"The return value i is such that all e in a[:i] have e <= x, and all e in\n"
"a[i:] have e > x. So if x already appears in the list, a.insert(i, x) will\n"
"insert just after the rightmost x already there.\n"
"a[i:] have e > x. So if x already appears in the list, a.insert(i, x)\n"
"will insert just after the rightmost x already there.\n"
"\n"
"Optional args lo (default 0) and hi (default len(a)) bound the\n"
"slice of a to be searched.\n"
@@ -235,8 +235,8 @@ PyDoc_STRVAR(_bisect_bisect_left__doc__,
"Return the index where to insert item x in list a, assuming a is sorted.\n"
"\n"
"The return value i is such that all e in a[:i] have e < x, and all e in\n"
"a[i:] have e >= x. So if x already appears in the list, a.insert(i, x) will\n"
"insert just before the leftmost x already there.\n"
"a[i:] have e >= x. So if x already appears in the list, a.insert(i, x)\n"
"will insert just before the leftmost x already there.\n"
"\n"
"Optional args lo (default 0) and hi (default len(a)) bound the\n"
"slice of a to be searched.\n"
@@ -446,4 +446,4 @@ skip_optional_kwonly:
exit:
return return_value;
}
/*[clinic end generated code: output=729385c6a23828ab input=a9049054013a1b77]*/
/*[clinic end generated code: output=5e0b8c4e5e697eae input=a9049054013a1b77]*/
+12 -11
View File
@@ -116,18 +116,19 @@ PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__,
"\n"
"Decompress *data*, returning uncompressed data as bytes.\n"
"\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
"decompressed data. If this limit is reached and further output can be\n"
"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes\n"
"of decompressed data. If this limit is reached and further output\n"
"can be produced, *self.needs_input* will be set to ``False``. In\n"
"this case, the next call to *decompress()* may provide *data* as b\'\'\n"
"to obtain more of the output.\n"
"\n"
"If all of the input data was decompressed and returned (either because this\n"
"was less than *max_length* bytes, or because *max_length* was negative),\n"
"*self.needs_input* will be set to True.\n"
"If all of the input data was decompressed and returned (either\n"
"because this was less than *max_length* bytes, or because\n"
"*max_length* was negative), *self.needs_input* will be set to True.\n"
"\n"
"Attempting to decompress data after the end of stream is reached raises an\n"
"EOFError. Any data found after the end of the stream is ignored and saved in\n"
"the unused_data attribute.");
"Attempting to decompress data after the end of stream is reached\n"
"raises an EOFError. Any data found after the end of the stream is\n"
"ignored and saved in the unused_data attribute.");
#define _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF \
{"decompress", _PyCFunction_CAST(_bz2_BZ2Decompressor_decompress), METH_FASTCALL|METH_KEYWORDS, _bz2_BZ2Decompressor_decompress__doc__},
@@ -237,4 +238,4 @@ _bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
/*[clinic end generated code: output=552ac6d4c5a101b7 input=a9049054013a1b77]*/
/*[clinic end generated code: output=1dce5396d592bad7 input=a9049054013a1b77]*/
+18 -16
View File
@@ -14,9 +14,10 @@ PyDoc_STRVAR(_codecs_register__doc__,
"\n"
"Register a codec search function.\n"
"\n"
"Search functions are expected to take one argument, the encoding name in\n"
"all lower case letters, and either return None, or a tuple of functions\n"
"(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).");
"Search functions are expected to take one argument, the encoding\n"
"name in all lower case letters, and either return None, or a tuple\n"
"of functions (encoder, decoder, stream_reader, stream_writer) (or\n"
"a CodecInfo object).");
#define _CODECS_REGISTER_METHODDEF \
{"register", (PyCFunction)_codecs_register, METH_O, _codecs_register__doc__},
@@ -76,10 +77,10 @@ PyDoc_STRVAR(_codecs_encode__doc__,
"Encodes obj using the codec registered for encoding.\n"
"\n"
"The default encoding is \'utf-8\'. errors may be given to set a\n"
"different error handling scheme. Default is \'strict\' meaning that encoding\n"
"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n"
"and \'backslashreplace\' as well as any other name registered with\n"
"codecs.register_error that can handle ValueErrors.");
"different error handling scheme. Default is \'strict\' meaning that\n"
"encoding errors raise a ValueError. Other possible values are \'ignore\',\n"
"\'replace\' and \'backslashreplace\' as well as any other name registered\n"
"with codecs.register_error that can handle ValueErrors.");
#define _CODECS_ENCODE_METHODDEF \
{"encode", _PyCFunction_CAST(_codecs_encode), METH_FASTCALL|METH_KEYWORDS, _codecs_encode__doc__},
@@ -179,10 +180,10 @@ PyDoc_STRVAR(_codecs_decode__doc__,
"Decodes obj using the codec registered for encoding.\n"
"\n"
"Default encoding is \'utf-8\'. errors may be given to set a\n"
"different error handling scheme. Default is \'strict\' meaning that encoding\n"
"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n"
"and \'backslashreplace\' as well as any other name registered with\n"
"codecs.register_error that can handle ValueErrors.");
"different error handling scheme. Default is \'strict\' meaning that\n"
"encoding errors raise a ValueError. Other possible values are \'ignore\',\n"
"\'replace\' and \'backslashreplace\' as well as any other name registered\n"
"with codecs.register_error that can handle ValueErrors.");
#define _CODECS_DECODE_METHODDEF \
{"decode", _PyCFunction_CAST(_codecs_decode), METH_FASTCALL|METH_KEYWORDS, _codecs_decode__doc__},
@@ -2649,8 +2650,9 @@ PyDoc_STRVAR(_codecs_register_error__doc__,
"Register the specified error handler under the name errors.\n"
"\n"
"handler must be a callable object, that will be called with an exception\n"
"instance containing information about the location of the encoding/decoding\n"
"error and must return a (replacement, new position) tuple.");
"instance containing information about the location of the\n"
"encoding/decoding error and must return a (replacement, new position)\n"
"tuple.");
#define _CODECS_REGISTER_ERROR_METHODDEF \
{"register_error", _PyCFunction_CAST(_codecs_register_error), METH_FASTCALL, _codecs_register_error__doc__},
@@ -2745,8 +2747,8 @@ PyDoc_STRVAR(_codecs_lookup_error__doc__,
"\n"
"lookup_error(errors) -> handler\n"
"\n"
"Return the error handler for the specified error handling name or raise a\n"
"LookupError, if no handler exists under this name.");
"Return the error handler for the specified error handling name or raise\n"
"a LookupError, if no handler exists under this name.");
#define _CODECS_LOOKUP_ERROR_METHODDEF \
{"lookup_error", (PyCFunction)_codecs_lookup_error, METH_O, _codecs_lookup_error__doc__},
@@ -2802,4 +2804,4 @@ exit:
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
/*[clinic end generated code: output=ed13f20dfb09e306 input=a9049054013a1b77]*/
/*[clinic end generated code: output=eb221ef27f132476 input=a9049054013a1b77]*/
+3 -3
View File
@@ -14,8 +14,8 @@ PyDoc_STRVAR(datetime_date_fromtimestamp__doc__,
"\n"
"Create a date from a POSIX timestamp.\n"
"\n"
"The timestamp is a number, e.g. created via time.time(), that is interpreted\n"
"as local time.");
"The timestamp is a number, e.g. created via time.time(), that is\n"
"interpreted as local time.");
#define DATETIME_DATE_FROMTIMESTAMP_METHODDEF \
{"fromtimestamp", (PyCFunction)datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__},
@@ -524,4 +524,4 @@ skip_optional_kwonly:
exit:
return return_value;
}
/*[clinic end generated code: output=809640e747529c72 input=a9049054013a1b77]*/
/*[clinic end generated code: output=847b941002d485a8 input=a9049054013a1b77]*/
+3 -2
View File
@@ -113,7 +113,8 @@ PyDoc_STRVAR(_dbm_dbm_setdefault__doc__,
"\n"
"Return the value for key if present, otherwise default.\n"
"\n"
"If key is not in the database, it is inserted with default as the value.");
"If key is not in the database, it is inserted with default as the\n"
"value.");
#define _DBM_DBM_SETDEFAULT_METHODDEF \
{"setdefault", _PyCFunction_CAST(_dbm_dbm_setdefault), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _dbm_dbm_setdefault__doc__},
@@ -246,4 +247,4 @@ skip_optional:
exit:
return return_value;
}
/*[clinic end generated code: output=279511ea7cda38dd input=a9049054013a1b77]*/
/*[clinic end generated code: output=677deecf525167a5 input=a9049054013a1b77]*/
+4 -4
View File
@@ -76,9 +76,9 @@ PyDoc_STRVAR(_functools_reduce__doc__,
"\n"
"Apply a function of two arguments cumulatively to the items of an iterable, from left to right.\n"
"\n"
"This effectively reduces the iterable to a single value. If initial is present,\n"
"it is placed before the items of the iterable in the calculation, and serves as\n"
"a default when the iterable is empty.\n"
"This effectively reduces the iterable to a single value. If initial is\n"
"present, it is placed before the items of the iterable in the\n"
"calculation, and serves as a default when the iterable is empty.\n"
"\n"
"For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])\n"
"calculates ((((1 + 2) + 3) + 4) + 5).");
@@ -192,4 +192,4 @@ _functools__lru_cache_wrapper_cache_clear(PyObject *self, PyObject *Py_UNUSED(ig
return return_value;
}
/*[clinic end generated code: output=7f2abc718fcc35d5 input=a9049054013a1b77]*/
/*[clinic end generated code: output=1c44abd7e56118dc input=a9049054013a1b77]*/
+9 -9
View File
@@ -138,9 +138,9 @@ PyDoc_STRVAR(_gdbm_gdbm_firstkey__doc__,
"\n"
"Return the starting key for the traversal.\n"
"\n"
"It\'s possible to loop over every key in the database using this method\n"
"and the nextkey() method. The traversal is ordered by GDBM\'s internal\n"
"hash values, and won\'t be sorted by the key values.");
"It\'s possible to loop over every key in the database using this\n"
"method and the nextkey() method. The traversal is ordered by GDBM\'s\n"
"internal hash values, and won\'t be sorted by the key values.");
#define _GDBM_GDBM_FIRSTKEY_METHODDEF \
{"firstkey", _PyCFunction_CAST(_gdbm_gdbm_firstkey), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _gdbm_gdbm_firstkey__doc__},
@@ -171,8 +171,8 @@ PyDoc_STRVAR(_gdbm_gdbm_nextkey__doc__,
"\n"
"Returns the key that follows key in the traversal.\n"
"\n"
"The following code prints every key in the database db, without having\n"
"to create a list in memory that contains them all:\n"
"The following code prints every key in the database db, without\n"
"having to create a list in memory that contains them all:\n"
"\n"
" k = db.firstkey()\n"
" while k is not None:\n"
@@ -226,9 +226,9 @@ PyDoc_STRVAR(_gdbm_gdbm_reorganize__doc__,
"\n"
"If you have carried out a lot of deletions and would like to shrink\n"
"the space used by the GDBM file, this routine will reorganize the\n"
"database. GDBM will not shorten the length of a database file except\n"
"by using this reorganization; otherwise, deleted file space will be\n"
"kept and reused as new (key,value) pairs are added.");
"database. GDBM will not shorten the length of a database file\n"
"except by using this reorganization; otherwise, deleted file space\n"
"will be kept and reused as new (key,value) pairs are added.");
#define _GDBM_GDBM_REORGANIZE_METHODDEF \
{"reorganize", _PyCFunction_CAST(_gdbm_gdbm_reorganize), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _gdbm_gdbm_reorganize__doc__},
@@ -389,4 +389,4 @@ skip_optional:
exit:
return return_value;
}
/*[clinic end generated code: output=8bca34ce9d4493dd input=a9049054013a1b77]*/
/*[clinic end generated code: output=429b5db24568292e input=a9049054013a1b77]*/
+5 -5
View File
@@ -1859,8 +1859,8 @@ PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__,
"\n"
"Return hexadecimal digest of the bytes passed to the update() method so far.\n"
"\n"
"This may be used to exchange the value safely in email or other non-binary\n"
"environments.");
"This may be used to exchange the value safely in email or other\n"
"non-binary environments.");
#define _HASHLIB_HMAC_HEXDIGEST_METHODDEF \
{"hexdigest", (PyCFunction)_hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__},
@@ -1881,8 +1881,8 @@ PyDoc_STRVAR(_hashlib_get_fips_mode__doc__,
"Determine the OpenSSL FIPS mode of operation.\n"
"\n"
"For OpenSSL 3.0.0 and newer it returns the state of the default provider\n"
"in the default OSSL context. It\'s not quite the same as FIPS_mode() but good\n"
"enough for unittests.\n"
"in the default OSSL context. It\'s not quite the same as FIPS_mode() but\n"
"good enough for unittests.\n"
"\n"
"Effectively any non-zero return value indicates FIPS mode;\n"
"values other than 1 may have additional significance.");
@@ -1984,4 +1984,4 @@ exit:
#ifndef _HASHLIB_SCRYPT_METHODDEF
#define _HASHLIB_SCRYPT_METHODDEF
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
/*[clinic end generated code: output=a863ec4166ed2fbb input=a9049054013a1b77]*/
/*[clinic end generated code: output=3e8d61a057978436 input=a9049054013a1b77]*/
+3 -3
View File
@@ -326,8 +326,8 @@ PyDoc_STRVAR(_heapq_heappushpop_max__doc__,
"\n"
"Maxheap variant of heappushpop.\n"
"\n"
"The combined action runs more efficiently than heappush_max() followed by\n"
"a separate call to heappop_max().");
"The combined action runs more efficiently than heappush_max()\n"
"followed by a separate call to heappop_max().");
#define _HEAPQ_HEAPPUSHPOP_MAX_METHODDEF \
{"heappushpop_max", _PyCFunction_CAST(_heapq_heappushpop_max), METH_FASTCALL, _heapq_heappushpop_max__doc__},
@@ -358,4 +358,4 @@ _heapq_heappushpop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs
exit:
return return_value;
}
/*[clinic end generated code: output=e83d50002c29a96d input=a9049054013a1b77]*/
/*[clinic end generated code: output=21e4f248ef6e83d6 input=a9049054013a1b77]*/
+12 -11
View File
@@ -74,18 +74,19 @@ PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__,
"\n"
"Decompress *data*, returning uncompressed data as bytes.\n"
"\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
"decompressed data. If this limit is reached and further output can be\n"
"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes\n"
"of decompressed data. If this limit is reached and further output\n"
"can be produced, *self.needs_input* will be set to ``False``. In\n"
"this case, the next call to *decompress()* may provide *data* as b\'\'\n"
"to obtain more of the output.\n"
"\n"
"If all of the input data was decompressed and returned (either because this\n"
"was less than *max_length* bytes, or because *max_length* was negative),\n"
"*self.needs_input* will be set to True.\n"
"If all of the input data was decompressed and returned (either\n"
"because this was less than *max_length* bytes, or because\n"
"*max_length* was negative), *self.needs_input* will be set to True.\n"
"\n"
"Attempting to decompress data after the end of stream is reached raises an\n"
"EOFError. Any data found after the end of the stream is ignored and saved in\n"
"the unused_data attribute.");
"Attempting to decompress data after the end of stream is reached\n"
"raises an EOFError. Any data found after the end of the stream is\n"
"ignored and saved in the unused_data attribute.");
#define _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF \
{"decompress", _PyCFunction_CAST(_lzma_LZMADecompressor_decompress), METH_FASTCALL|METH_KEYWORDS, _lzma_LZMADecompressor_decompress__doc__},
@@ -333,4 +334,4 @@ exit:
return return_value;
}
/*[clinic end generated code: output=6386084cb43d2533 input=a9049054013a1b77]*/
/*[clinic end generated code: output=ffc6d673d858048c input=a9049054013a1b77]*/
+8 -8
View File
@@ -14,15 +14,15 @@ PyDoc_STRVAR(subprocess_fork_exec__doc__,
"\n"
"Spawn a fresh new child process.\n"
"\n"
"Fork a child process, close parent file descriptors as appropriate in the\n"
"child and duplicate the few that are needed before calling exec() in the\n"
"child process.\n"
"Fork a child process, close parent file descriptors as appropriate in\n"
"the child and duplicate the few that are needed before calling exec() in\n"
"the child process.\n"
"\n"
"If close_fds is True, close file descriptors 3 and higher, except those listed\n"
"in the sorted tuple pass_fds.\n"
"If close_fds is True, close file descriptors 3 and higher, except those\n"
"listed in the sorted tuple pass_fds.\n"
"\n"
"The preexec_fn, if supplied, will be called immediately before closing file\n"
"descriptors and exec.\n"
"The preexec_fn, if supplied, will be called immediately before closing\n"
"file descriptors and exec.\n"
"\n"
"WARNING: preexec_fn is NOT SAFE if your application uses threads.\n"
" It may trigger infrequent, difficult to debug deadlocks.\n"
@@ -150,4 +150,4 @@ subprocess_fork_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=942bc2748a9c2785 input=a9049054013a1b77]*/
/*[clinic end generated code: output=138941c284792aa1 input=a9049054013a1b77]*/
+9 -7
View File
@@ -44,8 +44,9 @@ PyDoc_STRVAR(_queue_SimpleQueue_put__doc__,
"\n"
"Put the item on the queue.\n"
"\n"
"The optional \'block\' and \'timeout\' arguments are ignored, as this method\n"
"never blocks. They are provided for compatibility with the Queue class.");
"The optional \'block\' and \'timeout\' arguments are ignored, as this\n"
"method never blocks. They are provided for compatibility with the\n"
"Queue class.");
#define _QUEUE_SIMPLEQUEUE_PUT_METHODDEF \
{"put", _PyCFunction_CAST(_queue_SimpleQueue_put), METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put__doc__},
@@ -188,10 +189,11 @@ PyDoc_STRVAR(_queue_SimpleQueue_get__doc__,
"\n"
"Remove and return an item from the queue.\n"
"\n"
"If optional args \'block\' is true and \'timeout\' is None (the default),\n"
"block if necessary until an item is available. If \'timeout\' is\n"
"a non-negative number, it blocks at most \'timeout\' seconds and raises\n"
"the Empty exception if no item was available within that time.\n"
"If optional args \'block\' is true and \'timeout\' is None (the\n"
"default), block if necessary until an item is available. If\n"
"\'timeout\' is a non-negative number, it blocks at most \'timeout\'\n"
"seconds and raises the Empty exception if no item was available\n"
"within that time.\n"
"Otherwise (\'block\' is false), return an item if one is immediately\n"
"available, else raise the Empty exception (\'timeout\' is ignored\n"
"in that case).");
@@ -358,4 +360,4 @@ _queue_SimpleQueue_qsize(PyObject *self, PyObject *Py_UNUSED(ignored))
exit:
return return_value;
}
/*[clinic end generated code: output=1d3efe9df89997cf input=a9049054013a1b77]*/
/*[clinic end generated code: output=58cfee868040d297 input=a9049054013a1b77]*/
+26 -23
View File
@@ -264,9 +264,10 @@ _ssl__SSLSocket_compression(PyObject *self, PyObject *Py_UNUSED(ignored))
PyDoc_STRVAR(_ssl__SSLSocket_context__doc__,
"This changes the context associated with the SSLSocket.\n"
"\n"
"This is typically used from within a callback function set by the sni_callback\n"
"on the SSLContext to change the certificate information associated with the\n"
"SSLSocket before the cryptographic exchange handshake messages.");
"This is typically used from within a callback function set by the\n"
"sni_callback on the SSLContext to change the certificate information\n"
"associated with the SSLSocket before the cryptographic exchange\n"
"handshake messages.");
#if defined(_ssl__SSLSocket_context_DOCSTR)
# undef _ssl__SSLSocket_context_DOCSTR
#endif
@@ -583,8 +584,9 @@ PyDoc_STRVAR(_ssl__SSLSocket_get_channel_binding__doc__,
"\n"
"Get channel binding data for current connection.\n"
"\n"
"Raise ValueError if the requested `cb_type` is not supported. Return bytes\n"
"of the data or None if the data is not available (e.g. before the handshake).\n"
"Raise ValueError if the requested `cb_type` is not supported.\n"
"Return bytes of the data or None if the data is not available (e.g.\n"
"before the handshake).\n"
"Only \'tls-unique\' channel binding data from RFC 5929 is supported.");
#define _SSL__SSLSOCKET_GET_CHANNEL_BINDING_METHODDEF \
@@ -1811,8 +1813,9 @@ _ssl__SSLContext_set_ecdh_curve(PyObject *self, PyObject *name)
PyDoc_STRVAR(_ssl__SSLContext_sni_callback__doc__,
"Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.\n"
"\n"
"If the argument is None then the callback is disabled. The method is called\n"
"with the SSLSocket, the server name as a string, and the SSLContext object.\n"
"If the argument is None then the callback is disabled. The method\n"
"is called with the SSLSocket, the server name as a string, and the\n"
"SSLContext object.\n"
"\n"
"See RFC 6066 for details of the SNI extension.");
#if defined(_ssl__SSLContext_sni_callback_DOCSTR)
@@ -1876,11 +1879,11 @@ PyDoc_STRVAR(_ssl__SSLContext_cert_store_stats__doc__,
"\n"
"Returns quantities of loaded X.509 certificates.\n"
"\n"
"X.509 certificates with a CA extension and certificate revocation lists\n"
"inside the context\'s cert store.\n"
"X.509 certificates with a CA extension and certificate revocation\n"
"lists inside the context\'s cert store.\n"
"\n"
"NOTE: Certificates in a capath directory aren\'t loaded unless they have\n"
"been used at least once.");
"NOTE: Certificates in a capath directory aren\'t loaded unless they\n"
"have been used at least once.");
#define _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF \
{"cert_store_stats", (PyCFunction)_ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__},
@@ -1906,11 +1909,11 @@ PyDoc_STRVAR(_ssl__SSLContext_get_ca_certs__doc__,
"\n"
"Returns a list of dicts with information of loaded CA certs.\n"
"\n"
"If the optional argument is True, returns a DER-encoded copy of the CA\n"
"certificate.\n"
"If the optional argument is True, returns a DER-encoded copy of the\n"
"CA certificate.\n"
"\n"
"NOTE: Certificates in a capath directory aren\'t loaded unless they have\n"
"been used at least once.");
"NOTE: Certificates in a capath directory aren\'t loaded unless they\n"
"have been used at least once.");
#define _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF \
{"get_ca_certs", _PyCFunction_CAST(_ssl__SSLContext_get_ca_certs), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__},
@@ -2571,8 +2574,8 @@ PyDoc_STRVAR(_ssl_RAND_status__doc__,
"\n"
"Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.\n"
"\n"
"It is necessary to seed the PRNG with RAND_add() on some platforms before\n"
"using the ssl() function.");
"It is necessary to seed the PRNG with RAND_add() on some platforms\n"
"before using the ssl() function.");
#define _SSL_RAND_STATUS_METHODDEF \
{"RAND_status", (PyCFunction)_ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__},
@@ -2741,11 +2744,11 @@ PyDoc_STRVAR(_ssl_enum_certificates__doc__,
"\n"
"Retrieve certificates from Windows\' cert store.\n"
"\n"
"store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may provide\n"
"more cert storages, too. The function returns a list of (bytes,\n"
"encoding_type, trust) tuples. The encoding_type flag can be interpreted\n"
"with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The trust setting is either\n"
"a set of OIDs or the boolean True.");
"store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may\n"
"provide more cert storages, too. The function returns a list of\n"
"(bytes, encoding_type, trust) tuples. The encoding_type flag can be\n"
"interpreted with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The\n"
"trust setting is either a set of OIDs or the boolean True.");
#define _SSL_ENUM_CERTIFICATES_METHODDEF \
{"enum_certificates", _PyCFunction_CAST(_ssl_enum_certificates), METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__},
@@ -2903,4 +2906,4 @@ exit:
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
/*[clinic end generated code: output=cbd8526cd625c433 input=a9049054013a1b77]*/
/*[clinic end generated code: output=6b5d14b14e152522 input=a9049054013a1b77]*/
+3 -3
View File
@@ -14,8 +14,8 @@ PyDoc_STRVAR(_testmultiphase_StateAccessType_get_defining_module__doc__,
"\n"
"Return the module of the defining class.\n"
"\n"
"Also tests that result of PyType_GetModuleByDef matches defining_class\'s\n"
"module.");
"Also tests that result of PyType_GetModuleByDef matches\n"
"defining_class\'s module.");
#define _TESTMULTIPHASE_STATEACCESSTYPE_GET_DEFINING_MODULE_METHODDEF \
{"get_defining_module", _PyCFunction_CAST(_testmultiphase_StateAccessType_get_defining_module), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _testmultiphase_StateAccessType_get_defining_module__doc__},
@@ -165,4 +165,4 @@ _testmultiphase_StateAccessType_get_count(PyObject *self, PyTypeObject *cls, PyO
}
return _testmultiphase_StateAccessType_get_count_impl((StateAccessTypeObject *)self, cls);
}
/*[clinic end generated code: output=8eed2f14292ec986 input=a9049054013a1b77]*/
/*[clinic end generated code: output=aff91f6219a7baca input=a9049054013a1b77]*/
+3 -2
View File
@@ -907,7 +907,8 @@ PyDoc_STRVAR(_tkinter_setbusywaitinterval__doc__,
"\n"
"Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.\n"
"\n"
"It should be set to a divisor of the maximum time between frames in an animation.");
"It should be set to a divisor of the maximum time between frames in\n"
"an animation.");
#define _TKINTER_SETBUSYWAITINTERVAL_METHODDEF \
{"setbusywaitinterval", (PyCFunction)_tkinter_setbusywaitinterval, METH_O, _tkinter_setbusywaitinterval__doc__},
@@ -966,4 +967,4 @@ exit:
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
/*[clinic end generated code: output=052c067aa69237be input=a9049054013a1b77]*/
/*[clinic end generated code: output=c807adb73e305725 input=a9049054013a1b77]*/
+12 -11
View File
@@ -292,8 +292,8 @@ PyDoc_STRVAR(array_array_buffer_info__doc__,
"\n"
"Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array\'s contents.\n"
"\n"
"The length should be multiplied by the itemsize attribute to calculate\n"
"the buffer length in bytes.");
"The length should be multiplied by the itemsize attribute to\n"
"calculate the buffer length in bytes.");
#define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \
{"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__},
@@ -335,8 +335,8 @@ PyDoc_STRVAR(array_array_byteswap__doc__,
"\n"
"Byteswap all items of the array.\n"
"\n"
"If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is\n"
"raised.");
"If the items in the array are not 1, 2, 4, or 8 bytes in size,\n"
"RuntimeError is raised.");
#define ARRAY_ARRAY_BYTESWAP_METHODDEF \
{"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__},
@@ -566,9 +566,9 @@ PyDoc_STRVAR(array_array_fromunicode__doc__,
"\n"
"Extends this array with data from the unicode string ustr.\n"
"\n"
"The array must be a unicode type array; otherwise a ValueError is raised.\n"
"Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of\n"
"some other type.");
"The array must be a unicode type array; otherwise a ValueError is\n"
"raised. Use array.frombytes(ustr.encode(...)) to append Unicode\n"
"data to an array of some other type.");
#define ARRAY_ARRAY_FROMUNICODE_METHODDEF \
{"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__},
@@ -599,9 +599,10 @@ PyDoc_STRVAR(array_array_tounicode__doc__,
"\n"
"Extends this array with data from the unicode string ustr.\n"
"\n"
"Convert the array to a unicode string. The array must be a unicode type array;\n"
"otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a\n"
"unicode string from an array of some other type.");
"Convert the array to a unicode string. The array must be a unicode\n"
"type array; otherwise a ValueError is raised. Use\n"
"array.tobytes().decode() to obtain a unicode string from an array of\n"
"some other type.");
#define ARRAY_ARRAY_TOUNICODE_METHODDEF \
{"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__},
@@ -773,4 +774,4 @@ array_arrayiterator___setstate__(PyObject *self, PyObject *state)
return return_value;
}
/*[clinic end generated code: output=dd49451ac1cc3f39 input=a9049054013a1b77]*/
/*[clinic end generated code: output=bdd96ce6f32596b1 input=a9049054013a1b77]*/
+8 -6
View File
@@ -644,7 +644,8 @@ PyDoc_STRVAR(cmath_log__doc__,
"\n"
"log(z[, base]) -> the logarithm of z to the given base.\n"
"\n"
"If the base is not specified, returns the natural logarithm (base e) of z.");
"If the base is not specified, returns the natural logarithm (base e)\n"
"of z.");
#define CMATH_LOG_METHODDEF \
{"log", _PyCFunction_CAST(cmath_log), METH_FASTCALL, cmath_log__doc__},
@@ -882,11 +883,12 @@ PyDoc_STRVAR(cmath_isclose__doc__,
"\n"
"Return True if a is close in value to b, and False otherwise.\n"
"\n"
"For the values to be considered close, the difference between them must be\n"
"smaller than at least one of the tolerances.\n"
"For the values to be considered close, the difference between them must\n"
"be smaller than at least one of the tolerances.\n"
"\n"
"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is\n"
"not close to anything, even itself. inf and -inf are only close to themselves.");
"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is,\n"
"NaN is not close to anything, even itself. inf and -inf are only close\n"
"to themselves.");
#define CMATH_ISCLOSE_METHODDEF \
{"isclose", _PyCFunction_CAST(cmath_isclose), METH_FASTCALL|METH_KEYWORDS, cmath_isclose__doc__},
@@ -985,4 +987,4 @@ skip_optional_kwonly:
exit:
return return_value;
}
/*[clinic end generated code: output=631db17fb1c79d66 input=a9049054013a1b77]*/
/*[clinic end generated code: output=7d5ad4cf258526cd input=a9049054013a1b77]*/
+7 -6
View File
@@ -377,8 +377,8 @@ PyDoc_STRVAR(gc_get_objects__doc__,
" generation\n"
" Generation to extract the objects from.\n"
"\n"
"If generation is not None, return only the objects tracked by the collector\n"
"that are in that generation.");
"If generation is not None, return only the objects tracked by the\n"
"collector that are in that generation.");
#define GC_GET_OBJECTS_METHODDEF \
{"get_objects", _PyCFunction_CAST(gc_get_objects), METH_FASTCALL|METH_KEYWORDS, gc_get_objects__doc__},
@@ -521,9 +521,10 @@ PyDoc_STRVAR(gc_freeze__doc__,
"\n"
"Freeze all current tracked objects and ignore them for future collections.\n"
"\n"
"This can be used before a POSIX fork() call to make the gc copy-on-write friendly.\n"
"Note: collection before a POSIX fork() call may free pages for future allocation\n"
"which can cause copy-on-write.");
"This can be used before a POSIX fork() call to make the gc copy-on-write\n"
"friendly.\n"
"Note: collection before a POSIX fork() call may free pages for future\n"
"allocation which can cause copy-on-write.");
#define GC_FREEZE_METHODDEF \
{"freeze", (PyCFunction)gc_freeze, METH_NOARGS, gc_freeze__doc__},
@@ -584,4 +585,4 @@ gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored))
exit:
return return_value;
}
/*[clinic end generated code: output=96d057eac558e6ca input=a9049054013a1b77]*/
/*[clinic end generated code: output=41268fc41eac6b64 input=a9049054013a1b77]*/
+3 -3
View File
@@ -187,8 +187,8 @@ PyDoc_STRVAR(_hmac_HMAC_hexdigest__doc__,
"\n"
"Return hexadecimal digest of the bytes passed to the update() method so far.\n"
"\n"
"This may be used to exchange the value safely in email or other non-binary\n"
"environments.\n"
"This may be used to exchange the value safely in email or other\n"
"non-binary environments.\n"
"\n"
"This method may raise a MemoryError.");
@@ -670,4 +670,4 @@ _hmac_compute_blake2b_32(PyObject *module, PyObject *const *args, Py_ssize_t nar
exit:
return return_value;
}
/*[clinic end generated code: output=30c0614482d963f5 input=a9049054013a1b77]*/
/*[clinic end generated code: output=6ec5948df1c5569a input=a9049054013a1b77]*/
+3 -3
View File
@@ -799,8 +799,8 @@ PyDoc_STRVAR(itertools_compress__doc__,
"\n"
"Return data elements corresponding to true selector elements.\n"
"\n"
"Forms a shorter iterator from selected data elements using the selectors to\n"
"choose the data elements.");
"Forms a shorter iterator from selected data elements using the selectors\n"
"to choose the data elements.");
static PyObject *
itertools_compress_impl(PyTypeObject *type, PyObject *seq1, PyObject *seq2);
@@ -965,4 +965,4 @@ skip_optional_pos:
exit:
return return_value;
}
/*[clinic end generated code: output=999758202a532e0a input=a9049054013a1b77]*/
/*[clinic end generated code: output=59abbdf1cbb2e24b input=a9049054013a1b77]*/
+3 -3
View File
@@ -990,8 +990,8 @@ PyDoc_STRVAR(math_nextafter__doc__,
"\n"
"If steps is not specified or is None, it defaults to 1.\n"
"\n"
"Raises a TypeError, if x or y is not a double, or if steps is not an integer.\n"
"Raises ValueError if steps is negative.");
"Raises a TypeError, if x or y is not a double, or if steps is not\n"
"an integer. Raises ValueError if steps is negative.");
#define MATH_NEXTAFTER_METHODDEF \
{"nextafter", _PyCFunction_CAST(math_nextafter), METH_FASTCALL|METH_KEYWORDS, math_nextafter__doc__},
@@ -1110,4 +1110,4 @@ math_ulp(PyObject *module, PyObject *arg)
exit:
return return_value;
}
/*[clinic end generated code: output=77e7b8c161c39843 input=a9049054013a1b77]*/
/*[clinic end generated code: output=28730b795b51b528 input=a9049054013a1b77]*/
+4 -3
View File
@@ -529,8 +529,9 @@ PyDoc_STRVAR(_overlapped_Overlapped_getresult__doc__,
"\n"
"Retrieve result of operation.\n"
"\n"
"If wait is true then it blocks until the operation is finished. If wait\n"
"is false and the operation is still pending then an error is raised.");
"If wait is true then it blocks until the operation is finished. If\n"
"wait is false and the operation is still pending then an error is\n"
"raised.");
#define _OVERLAPPED_OVERLAPPED_GETRESULT_METHODDEF \
{"getresult", _PyCFunction_CAST(_overlapped_Overlapped_getresult), METH_FASTCALL, _overlapped_Overlapped_getresult__doc__},
@@ -1242,4 +1243,4 @@ exit:
return return_value;
}
/*[clinic end generated code: output=3e4cb2b55342cd96 input=a9049054013a1b77]*/
/*[clinic end generated code: output=0ecaf45a09539599 input=a9049054013a1b77]*/
+18 -17
View File
@@ -16,7 +16,8 @@ PyDoc_STRVAR(select_select__doc__,
"\n"
"Wait until one or more file descriptors are ready for some kind of I/O.\n"
"\n"
"The first three arguments are iterables of file descriptors to be waited for:\n"
"The first three arguments are iterables of file descriptors to be waited\n"
"for:\n"
"rlist -- wait until ready for reading\n"
"wlist -- wait until ready for writing\n"
"xlist -- wait for an \"exceptional condition\"\n"
@@ -29,9 +30,9 @@ PyDoc_STRVAR(select_select__doc__,
"a floating-point number to specify fractions of seconds. If it is absent\n"
"or None, the call will never time out.\n"
"\n"
"The return value is a tuple of three lists corresponding to the first three\n"
"arguments; each contains the subset of the corresponding file descriptors\n"
"that are ready.\n"
"The return value is a tuple of three lists corresponding to the first\n"
"three arguments; each contains the subset of the corresponding file\n"
"descriptors that are ready.\n"
"\n"
"*** IMPORTANT NOTICE ***\n"
"On Windows, only sockets are supported; on Unix, all file\n"
@@ -214,8 +215,8 @@ PyDoc_STRVAR(select_poll_poll__doc__,
" The maximum time to wait in milliseconds, or else None (or a negative\n"
" value) to wait indefinitely.\n"
"\n"
"Returns a list containing any descriptors that have events or errors to\n"
"report, as a list of (fd, event) 2-tuples.");
"Returns a list containing any descriptors that have events or errors\n"
"to report, as a list of (fd, event) 2-tuples.");
#define SELECT_POLL_POLL_METHODDEF \
{"poll", _PyCFunction_CAST(select_poll_poll), METH_FASTCALL, select_poll_poll__doc__},
@@ -396,11 +397,11 @@ PyDoc_STRVAR(select_devpoll_poll__doc__,
"Polls the set of registered file descriptors.\n"
"\n"
" timeout\n"
" The maximum time to wait in milliseconds, or else None (or a negative\n"
" value) to wait indefinitely.\n"
" The maximum time to wait in milliseconds, or else None (or\n"
" a negative value) to wait indefinitely.\n"
"\n"
"Returns a list containing any descriptors that have events or errors to\n"
"report, as a list of (fd, event) 2-tuples.");
"Returns a list containing any descriptors that have events or errors\n"
"to report, as a list of (fd, event) 2-tuples.");
#define SELECT_DEVPOLL_POLL_METHODDEF \
{"poll", _PyCFunction_CAST(select_devpoll_poll), METH_FASTCALL, select_devpoll_poll__doc__},
@@ -498,8 +499,8 @@ PyDoc_STRVAR(select_poll__doc__,
"\n"
"Returns a polling object.\n"
"\n"
"This object supports registering and unregistering file descriptors, and then\n"
"polling them for I/O events.");
"This object supports registering and unregistering file descriptors, and\n"
"then polling them for I/O events.");
#define SELECT_POLL_METHODDEF \
{"poll", (PyCFunction)select_poll, METH_NOARGS, select_poll__doc__},
@@ -523,8 +524,8 @@ PyDoc_STRVAR(select_devpoll__doc__,
"\n"
"Returns a polling object.\n"
"\n"
"This object supports registering and unregistering file descriptors, and then\n"
"polling them for I/O events.");
"This object supports registering and unregistering file descriptors, and\n"
"then polling them for I/O events.");
#define SELECT_DEVPOLL_METHODDEF \
{"devpoll", (PyCFunction)select_devpoll, METH_NOARGS, select_devpoll__doc__},
@@ -954,8 +955,8 @@ PyDoc_STRVAR(select_epoll_poll__doc__,
" maxevents\n"
" the maximum number of events returned; -1 means no limit\n"
"\n"
"Returns a list containing any descriptors that have events to report,\n"
"as a list of (fd, events) 2-tuples.");
"Returns a list containing any descriptors that have events to\n"
"report, as a list of (fd, events) 2-tuples.");
#define SELECT_EPOLL_POLL_METHODDEF \
{"poll", _PyCFunction_CAST(select_epoll_poll), METH_FASTCALL|METH_KEYWORDS, select_epoll_poll__doc__},
@@ -1375,4 +1376,4 @@ exit:
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
/*[clinic end generated code: output=6fc20d78802511d1 input=a9049054013a1b77]*/
/*[clinic end generated code: output=aac002a543ecb778 input=a9049054013a1b77]*/
+9 -8
View File
@@ -138,11 +138,12 @@ PyDoc_STRVAR(signal_signal__doc__,
"Set the action for the given signal.\n"
"\n"
"The action can be SIG_DFL, SIG_IGN, or a callable Python object.\n"
"The previous action is returned. See getsignal() for possible return values.\n"
"The previous action is returned. See getsignal() for possible return\n"
"values.\n"
"\n"
"*** IMPORTANT NOTICE ***\n"
"A signal handler function is called with two arguments:\n"
"the first is the signal number, the second is the interrupted stack frame.");
"A signal handler function is called with two arguments: the first is\n"
"the signal number, the second is the interrupted stack frame.");
#define SIGNAL_SIGNAL_METHODDEF \
{"signal", _PyCFunction_CAST(signal_signal), METH_FASTCALL, signal_signal__doc__},
@@ -362,8 +363,8 @@ PyDoc_STRVAR(signal_setitimer__doc__,
"\n"
"Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).\n"
"\n"
"The timer will fire after value seconds and after that every interval seconds.\n"
"The itimer can be cleared by setting seconds to zero.\n"
"The timer will fire after value seconds and after that every interval\n"
"seconds. The itimer can be cleared by setting seconds to zero.\n"
"\n"
"Returns old values as a tuple: (delay, interval).");
@@ -508,8 +509,8 @@ PyDoc_STRVAR(signal_sigwait__doc__,
"Wait for a signal.\n"
"\n"
"Suspend execution of the calling thread until the delivery of one of the\n"
"signals specified in the signal set sigset. The function accepts the signal\n"
"and returns the signal number.");
"signals specified in the signal set sigset. The function accepts the\n"
"signal and returns the signal number.");
#define SIGNAL_SIGWAIT_METHODDEF \
{"sigwait", (PyCFunction)signal_sigwait, METH_O, signal_sigwait__doc__},
@@ -779,4 +780,4 @@ exit:
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
/*[clinic end generated code: output=48bfaffeb25df5d2 input=a9049054013a1b77]*/
/*[clinic end generated code: output=a6158ef9ca1b5c2e input=a9049054013a1b77]*/
+3 -2
View File
@@ -270,7 +270,8 @@ PyDoc_STRVAR(termios_tcsetwinsize__doc__,
"Set the tty winsize for file descriptor fd.\n"
"\n"
"The winsize to be set is taken from the winsize argument, which\n"
"is a two-item tuple (ws_row, ws_col) like the one returned by tcgetwinsize().");
"is a two-item tuple (ws_row, ws_col) like the one returned by\n"
"tcgetwinsize().");
#define TERMIOS_TCSETWINSIZE_METHODDEF \
{"tcsetwinsize", (PyCFunction)(void(*)(void))termios_tcsetwinsize, METH_FASTCALL, termios_tcsetwinsize__doc__},
@@ -299,4 +300,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=c6c6192583b0da36 input=a9049054013a1b77]*/
/*[clinic end generated code: output=d2176c4d9043d3cc input=a9049054013a1b77]*/
+14 -13
View File
@@ -498,8 +498,8 @@ PyDoc_STRVAR(zlib_Decompress_decompress__doc__,
" Unconsumed input data will be stored in\n"
" the unconsumed_tail attribute.\n"
"\n"
"After calling this function, some of the input data may still be stored in\n"
"internal buffers for later processing.\n"
"After calling this function, some of the input data may still be\n"
"stored in internal buffers for later processing.\n"
"Call the flush() method to clear these buffers.");
#define ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF \
@@ -904,18 +904,19 @@ PyDoc_STRVAR(zlib_ZlibDecompressor_decompress__doc__,
"\n"
"Decompress *data*, returning uncompressed data as bytes.\n"
"\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
"decompressed data. If this limit is reached and further output can be\n"
"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
"If *max_length* is nonnegative, returns at most *max_length* bytes\n"
"of decompressed data. If this limit is reached and further output\n"
"can be produced, *self.needs_input* will be set to ``False``. In\n"
"this case, the next call to *decompress()* may provide *data* as b\'\'\n"
"to obtain more of the output.\n"
"\n"
"If all of the input data was decompressed and returned (either because this\n"
"was less than *max_length* bytes, or because *max_length* was negative),\n"
"*self.needs_input* will be set to True.\n"
"If all of the input data was decompressed and returned (either\n"
"because this was less than *max_length* bytes, or because\n"
"*max_length* was negative), *self.needs_input* will be set to True.\n"
"\n"
"Attempting to decompress data after the end of stream is reached raises an\n"
"EOFError. Any data found after the end of the stream is ignored and saved in\n"
"the unused_data attribute.");
"Attempting to decompress data after the end of stream is reached\n"
"raises an EOFError. Any data found after the end of the stream is\n"
"ignored and saved in the unused_data attribute.");
#define ZLIB_ZLIBDECOMPRESSOR_DECOMPRESS_METHODDEF \
{"decompress", _PyCFunction_CAST(zlib_ZlibDecompressor_decompress), METH_FASTCALL|METH_KEYWORDS, zlib_ZlibDecompressor_decompress__doc__},
@@ -1121,4 +1122,4 @@ exit:
#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
/*[clinic end generated code: output=3611ce90fe05accb input=a9049054013a1b77]*/
/*[clinic end generated code: output=99936d9996e595ff input=a9049054013a1b77]*/
+9 -7
View File
@@ -948,12 +948,13 @@ cmath.log
log(z[, base]) -> the logarithm of z to the given base.
If the base is not specified, returns the natural logarithm (base e) of z.
If the base is not specified, returns the natural logarithm (base e)
of z.
[clinic start generated code]*/
static PyObject *
cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj)
/*[clinic end generated code: output=4effdb7d258e0d94 input=e1f81d4fcfd26497]*/
/*[clinic end generated code: output=4effdb7d258e0d94 input=eb25de0757baf4a0]*/
{
Py_complex y;
@@ -1177,17 +1178,18 @@ Determine whether two complex numbers are close in value.
Return True if a is close in value to b, and False otherwise.
For the values to be considered close, the difference between them must be
smaller than at least one of the tolerances.
For the values to be considered close, the difference between them must
be smaller than at least one of the tolerances.
-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is
not close to anything, even itself. inf and -inf are only close to themselves.
-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is,
NaN is not close to anything, even itself. inf and -inf are only close
to themselves.
[clinic start generated code]*/
static int
cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
double rel_tol, double abs_tol)
/*[clinic end generated code: output=8a2486cc6e0014d1 input=df9636d7de1d4ac3]*/
/*[clinic end generated code: output=8a2486cc6e0014d1 input=301b56c90d9a79de]*/
{
double diff;
+8 -7
View File
@@ -326,13 +326,13 @@ gc.get_objects
Return a list of objects tracked by the collector (excluding the list returned).
If generation is not None, return only the objects tracked by the collector
that are in that generation.
If generation is not None, return only the objects tracked by the
collector that are in that generation.
[clinic start generated code]*/
static PyObject *
gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
/*[clinic end generated code: output=48b35fea4ba6cb0e input=ef7da9df9806754c]*/
/*[clinic end generated code: output=48b35fea4ba6cb0e input=3a819826fbde5eef]*/
{
if (PySys_Audit("gc.get_objects", "n", generation) < 0) {
return NULL;
@@ -442,14 +442,15 @@ gc.freeze
Freeze all current tracked objects and ignore them for future collections.
This can be used before a POSIX fork() call to make the gc copy-on-write friendly.
Note: collection before a POSIX fork() call may free pages for future allocation
which can cause copy-on-write.
This can be used before a POSIX fork() call to make the gc copy-on-write
friendly.
Note: collection before a POSIX fork() call may free pages for future
allocation which can cause copy-on-write.
[clinic start generated code]*/
static PyObject *
gc_freeze_impl(PyObject *module)
/*[clinic end generated code: output=502159d9cdc4c139 input=b602b16ac5febbe5]*/
/*[clinic end generated code: output=502159d9cdc4c139 input=989012d0ba5a066f]*/
{
PyInterpreterState *interp = _PyInterpreterState_GET();
_PyGC_Freeze(interp);
+3 -3
View File
@@ -1107,15 +1107,15 @@ _hmac.HMAC.hexdigest
Return hexadecimal digest of the bytes passed to the update() method so far.
This may be used to exchange the value safely in email or other non-binary
environments.
This may be used to exchange the value safely in email or other
non-binary environments.
This method may raise a MemoryError.
[clinic start generated code]*/
static PyObject *
_hmac_HMAC_hexdigest_impl(HMACObject *self)
/*[clinic end generated code: output=6659807a09ae14ec input=493b2db8013982b9]*/
/*[clinic end generated code: output=6659807a09ae14ec input=5ae03f21d69c970c]*/
{
assert(self->digest_size <= Py_hmac_hash_max_digest_size);
uint8_t digest[Py_hmac_hash_max_digest_size];
+3 -3
View File
@@ -3110,13 +3110,13 @@ itertools.compress.__new__
selectors as seq2: object
Return data elements corresponding to true selector elements.
Forms a shorter iterator from selected data elements using the selectors to
choose the data elements.
Forms a shorter iterator from selected data elements using the selectors
to choose the data elements.
[clinic start generated code]*/
static PyObject *
itertools_compress_impl(PyTypeObject *type, PyObject *seq1, PyObject *seq2)
/*[clinic end generated code: output=7e67157212ed09e0 input=79596d7cd20c77e5]*/
/*[clinic end generated code: output=7e67157212ed09e0 input=32ca4347dbc46749]*/
{
PyObject *data=NULL, *selectors=NULL;
compressobject *lz;
+3 -3
View File
@@ -3941,13 +3941,13 @@ Return the floating-point value the given number of steps after x towards y.
If steps is not specified or is None, it defaults to 1.
Raises a TypeError, if x or y is not a double, or if steps is not an integer.
Raises ValueError if steps is negative.
Raises a TypeError, if x or y is not a double, or if steps is not
an integer. Raises ValueError if steps is negative.
[clinic start generated code]*/
static PyObject *
math_nextafter_impl(PyObject *module, double x, double y, PyObject *steps)
/*[clinic end generated code: output=cc6511f02afc099e input=7f2a5842112af2b4]*/
/*[clinic end generated code: output=cc6511f02afc099e input=89764144d1a33160]*/
{
#if defined(_AIX)
if (x == y) {
+4 -3
View File
@@ -884,13 +884,14 @@ _overlapped.Overlapped.getresult
Retrieve result of operation.
If wait is true then it blocks until the operation is finished. If wait
is false and the operation is still pending then an error is raised.
If wait is true then it blocks until the operation is finished. If
wait is false and the operation is still pending then an error is
raised.
[clinic start generated code]*/
static PyObject *
_overlapped_Overlapped_getresult_impl(OverlappedObject *self, BOOL wait)
/*[clinic end generated code: output=8c9bd04d08994f6c input=aa5b03e9897ca074]*/
/*[clinic end generated code: output=8c9bd04d08994f6c input=852fbd817cbd2b3d]*/
{
DWORD transferred = 0;
BOOL ret;
+23 -22
View File
@@ -251,7 +251,8 @@ select.select
Wait until one or more file descriptors are ready for some kind of I/O.
The first three arguments are iterables of file descriptors to be waited for:
The first three arguments are iterables of file descriptors to be waited
for:
rlist -- wait until ready for reading
wlist -- wait until ready for writing
xlist -- wait for an "exceptional condition"
@@ -264,9 +265,9 @@ The optional 4th argument specifies a timeout in seconds; it may be
a floating-point number to specify fractions of seconds. If it is absent
or None, the call will never time out.
The return value is a tuple of three lists corresponding to the first three
arguments; each contains the subset of the corresponding file descriptors
that are ready.
The return value is a tuple of three lists corresponding to the first
three arguments; each contains the subset of the corresponding file
descriptors that are ready.
*** IMPORTANT NOTICE ***
On Windows, only sockets are supported; on Unix, all file
@@ -276,7 +277,7 @@ descriptors can be used.
static PyObject *
select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
PyObject *xlist, PyObject *timeout_obj)
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=1199d5e101abca4a]*/
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=34a2c2075ca9830e]*/
{
#ifdef SELECT_USES_HEAP
pylist *rfd2obj, *wfd2obj, *efd2obj;
@@ -613,13 +614,13 @@ select.poll.poll
Polls the set of registered file descriptors.
Returns a list containing any descriptors that have events or errors to
report, as a list of (fd, event) 2-tuples.
Returns a list containing any descriptors that have events or errors
to report, as a list of (fd, event) 2-tuples.
[clinic start generated code]*/
static PyObject *
select_poll_poll_impl(pollObject *self, PyObject *timeout_obj)
/*[clinic end generated code: output=876e837d193ed7e4 input=54310631457efdec]*/
/*[clinic end generated code: output=876e837d193ed7e4 input=e0a9c0aa283de8c8]*/
{
PyObject *result_list = NULL;
int poll_result, i, j;
@@ -941,19 +942,19 @@ select_devpoll_unregister_impl(devpollObject *self, int fd)
@critical_section
select.devpoll.poll
timeout as timeout_obj: object = None
The maximum time to wait in milliseconds, or else None (or a negative
value) to wait indefinitely.
The maximum time to wait in milliseconds, or else None (or
a negative value) to wait indefinitely.
/
Polls the set of registered file descriptors.
Returns a list containing any descriptors that have events or errors to
report, as a list of (fd, event) 2-tuples.
Returns a list containing any descriptors that have events or errors
to report, as a list of (fd, event) 2-tuples.
[clinic start generated code]*/
static PyObject *
select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj)
/*[clinic end generated code: output=2654e5457cca0b3c input=fe7a3f6dcbc118c5]*/
/*[clinic end generated code: output=2654e5457cca0b3c input=9e1672658d728539]*/
{
struct dvpoll dvp;
PyObject *result_list = NULL;
@@ -1203,13 +1204,13 @@ select.poll
Returns a polling object.
This object supports registering and unregistering file descriptors, and then
polling them for I/O events.
This object supports registering and unregistering file descriptors, and
then polling them for I/O events.
[clinic start generated code]*/
static PyObject *
select_poll_impl(PyObject *module)
/*[clinic end generated code: output=16a665a4e1d228c5 input=3f877909d5696bbf]*/
/*[clinic end generated code: output=16a665a4e1d228c5 input=0aefd4527e99e0aa]*/
{
return (PyObject *)newPollObject(module);
}
@@ -1221,13 +1222,13 @@ select.devpoll
Returns a polling object.
This object supports registering and unregistering file descriptors, and then
polling them for I/O events.
This object supports registering and unregistering file descriptors, and
then polling them for I/O events.
[clinic start generated code]*/
static PyObject *
select_devpoll_impl(PyObject *module)
/*[clinic end generated code: output=ea9213cc87fd9581 input=53a1af94564f00a3]*/
/*[clinic end generated code: output=ea9213cc87fd9581 input=4c2ac27d10248526]*/
{
return (PyObject *)newDevPollObject(module);
}
@@ -1569,14 +1570,14 @@ select.epoll.poll
Wait for events on the epoll file descriptor.
Returns a list containing any descriptors that have events to report,
as a list of (fd, events) 2-tuples.
Returns a list containing any descriptors that have events to
report, as a list of (fd, events) 2-tuples.
[clinic start generated code]*/
static PyObject *
select_epoll_poll_impl(pyEpoll_Object *self, PyObject *timeout_obj,
int maxevents)
/*[clinic end generated code: output=e02d121a20246c6c input=33d34a5ea430fd5b]*/
/*[clinic end generated code: output=e02d121a20246c6c input=5a49d65788c70c7a]*/
{
int nfds, i;
PyObject *elist = NULL, *etuple = NULL;
+11 -10
View File
@@ -469,16 +469,17 @@ signal.signal
Set the action for the given signal.
The action can be SIG_DFL, SIG_IGN, or a callable Python object.
The previous action is returned. See getsignal() for possible return values.
The previous action is returned. See getsignal() for possible return
values.
*** IMPORTANT NOTICE ***
A signal handler function is called with two arguments:
the first is the signal number, the second is the interrupted stack frame.
A signal handler function is called with two arguments: the first is
the signal number, the second is the interrupted stack frame.
[clinic start generated code]*/
static PyObject *
signal_signal_impl(PyObject *module, int signalnum, PyObject *handler)
/*[clinic end generated code: output=b44cfda43780f3a1 input=deee84af5fa0432c]*/
/*[clinic end generated code: output=b44cfda43780f3a1 input=99ce4035ec56ffc1]*/
{
_signal_module_state *modstate = get_signal_state(module);
PyObject *old_handler;
@@ -856,8 +857,8 @@ signal.setitimer
Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).
The timer will fire after value seconds and after that every interval seconds.
The itimer can be cleared by setting seconds to zero.
The timer will fire after value seconds and after that every interval
seconds. The itimer can be cleared by setting seconds to zero.
Returns old values as a tuple: (delay, interval).
[clinic start generated code]*/
@@ -865,7 +866,7 @@ Returns old values as a tuple: (delay, interval).
static PyObject *
signal_setitimer_impl(PyObject *module, int which, PyObject *seconds,
PyObject *interval)
/*[clinic end generated code: output=65f9dcbddc35527b input=de43daf194e6f66f]*/
/*[clinic end generated code: output=65f9dcbddc35527b input=bd9f0d2ed8614193]*/
{
_signal_module_state *modstate = get_signal_state(module);
@@ -1026,13 +1027,13 @@ signal.sigwait
Wait for a signal.
Suspend execution of the calling thread until the delivery of one of the
signals specified in the signal set sigset. The function accepts the signal
and returns the signal number.
signals specified in the signal set sigset. The function accepts the
signal and returns the signal number.
[clinic start generated code]*/
static PyObject *
signal_sigwait_impl(PyObject *module, sigset_t sigset)
/*[clinic end generated code: output=f43770699d682f96 input=a6fbd47b1086d119]*/
/*[clinic end generated code: output=f43770699d682f96 input=91773742dd416a3e]*/
{
int err, signum;
+3 -2
View File
@@ -483,12 +483,13 @@ termios.tcsetwinsize
Set the tty winsize for file descriptor fd.
The winsize to be set is taken from the winsize argument, which
is a two-item tuple (ws_row, ws_col) like the one returned by tcgetwinsize().
is a two-item tuple (ws_row, ws_col) like the one returned by
tcgetwinsize().
[clinic start generated code]*/
static PyObject *
termios_tcsetwinsize_impl(PyObject *module, int fd, PyObject *winsz)
/*[clinic end generated code: output=2ac3c9bb6eda83e1 input=4a06424465b24aee]*/
/*[clinic end generated code: output=2ac3c9bb6eda83e1 input=efc9beb16d06382a]*/
{
if (!PySequence_Check(winsz) || PySequence_Size(winsz) != 2) {
PyErr_SetString(PyExc_TypeError,
+15 -14
View File
@@ -875,15 +875,15 @@ zlib.Decompress.decompress
Return a bytes object containing the decompressed version of the data.
After calling this function, some of the input data may still be stored in
internal buffers for later processing.
After calling this function, some of the input data may still be
stored in internal buffers for later processing.
Call the flush() method to clear these buffers.
[clinic start generated code]*/
static PyObject *
zlib_Decompress_decompress_impl(compobject *self, PyTypeObject *cls,
Py_buffer *data, Py_ssize_t max_length)
/*[clinic end generated code: output=b024a93c2c922d57 input=bfb37b3864cfb606]*/
/*[clinic end generated code: output=b024a93c2c922d57 input=b8c9e2d124fe4720]*/
{
int err = Z_OK;
Py_ssize_t ibuflen;
@@ -1688,24 +1688,25 @@ zlib.ZlibDecompressor.decompress
Decompress *data*, returning uncompressed data as bytes.
If *max_length* is nonnegative, returns at most *max_length* bytes of
decompressed data. If this limit is reached and further output can be
produced, *self.needs_input* will be set to ``False``. In this case, the next
call to *decompress()* may provide *data* as b'' to obtain more of the output.
If *max_length* is nonnegative, returns at most *max_length* bytes
of decompressed data. If this limit is reached and further output
can be produced, *self.needs_input* will be set to ``False``. In
this case, the next call to *decompress()* may provide *data* as b''
to obtain more of the output.
If all of the input data was decompressed and returned (either because this
was less than *max_length* bytes, or because *max_length* was negative),
*self.needs_input* will be set to True.
If all of the input data was decompressed and returned (either
because this was less than *max_length* bytes, or because
*max_length* was negative), *self.needs_input* will be set to True.
Attempting to decompress data after the end of stream is reached raises an
EOFError. Any data found after the end of the stream is ignored and saved in
the unused_data attribute.
Attempting to decompress data after the end of stream is reached
raises an EOFError. Any data found after the end of the stream is
ignored and saved in the unused_data attribute.
[clinic start generated code]*/
static PyObject *
zlib_ZlibDecompressor_decompress_impl(ZlibDecompressor *self,
Py_buffer *data, Py_ssize_t max_length)
/*[clinic end generated code: output=990d32787b775f85 input=0b29d99715250b96]*/
/*[clinic end generated code: output=990d32787b775f85 input=6fb56d60b48cd843]*/
{
PyObject *result = NULL;
+15 -12
View File
@@ -10,8 +10,8 @@ PyDoc_STRVAR(_contextvars_Context_get__doc__,
"\n"
"Return the value for `key` if `key` has the value in the context object.\n"
"\n"
"If `key` does not exist, return `default`. If `default` is not given,\n"
"return None.");
"If `key` does not exist, return `default`. If `default` is not\n"
"given, return None.");
#define _CONTEXTVARS_CONTEXT_GET_METHODDEF \
{"get", _PyCFunction_CAST(_contextvars_Context_get), METH_FASTCALL, _contextvars_Context_get__doc__},
@@ -122,10 +122,12 @@ PyDoc_STRVAR(_contextvars_ContextVar_get__doc__,
"\n"
"Return a value for the context variable for the current context.\n"
"\n"
"If there is no value for the variable in the current context, the method will:\n"
" * return the value of the default argument of the method, if provided; or\n"
" * return the default value for the context variable, if it was created\n"
" with one; or\n"
"If there is no value for the variable in the current context, the\n"
"method will:\n"
" * return the value of the default argument of the method, if\n"
" provided; or\n"
" * return the default value for the context variable, if it was\n"
" created with one; or\n"
" * raise a LookupError.");
#define _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF \
@@ -160,10 +162,11 @@ PyDoc_STRVAR(_contextvars_ContextVar_set__doc__,
"\n"
"Call to set a new value for the context variable in the current context.\n"
"\n"
"The required value argument is the new value for the context variable.\n"
"The required value argument is the new value for the context\n"
"variable.\n"
"\n"
"Returns a Token object that can be used to restore the variable to its previous\n"
"value via the `ContextVar.reset()` method.");
"Returns a Token object that can be used to restore the variable to\n"
"its previous value via the `ContextVar.reset()` method.");
#define _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF \
{"set", (PyCFunction)_contextvars_ContextVar_set, METH_O, _contextvars_ContextVar_set__doc__},
@@ -187,8 +190,8 @@ PyDoc_STRVAR(_contextvars_ContextVar_reset__doc__,
"\n"
"Reset the context variable.\n"
"\n"
"The variable is reset to the value it had before the `ContextVar.set()` that\n"
"created the token was used.");
"The variable is reset to the value it had before the\n"
"`ContextVar.set()` that created the token was used.");
#define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \
{"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__},
@@ -256,4 +259,4 @@ token_exit(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
/*[clinic end generated code: output=3a04b2fddf24c3e9 input=a9049054013a1b77]*/
/*[clinic end generated code: output=90ec3e4375804e9b input=a9049054013a1b77]*/
+4 -3
View File
@@ -34,8 +34,9 @@ PyDoc_STRVAR(_imp_acquire_lock__doc__,
"\n"
"Acquires the interpreter\'s import lock for the current thread.\n"
"\n"
"This lock should be used by import hooks to ensure thread-safety when importing\n"
"modules. On platforms without threads, this function does nothing.");
"This lock should be used by import hooks to ensure thread-safety when\n"
"importing modules. On platforms without threads, this function does\n"
"nothing.");
#define _IMP_ACQUIRE_LOCK_METHODDEF \
{"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__},
@@ -629,4 +630,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
/*[clinic end generated code: output=24f597d6b0f3feed input=a9049054013a1b77]*/
/*[clinic end generated code: output=394455063b83475b input=a9049054013a1b77]*/
+5 -5
View File
@@ -195,8 +195,8 @@ PyDoc_STRVAR(marshal_dumps__doc__,
" allow_code\n"
" Allow to write code objects.\n"
"\n"
"Raise a ValueError exception if value has (or contains an object that has) an\n"
"unsupported type.");
"Raise a ValueError exception if value has (or contains an object that\n"
"has) an unsupported type.");
#define MARSHAL_DUMPS_METHODDEF \
{"dumps", _PyCFunction_CAST(marshal_dumps), METH_FASTCALL|METH_KEYWORDS, marshal_dumps__doc__},
@@ -280,8 +280,8 @@ PyDoc_STRVAR(marshal_loads__doc__,
" allow_code\n"
" Allow to load code objects.\n"
"\n"
"If no valid value is found, raise EOFError, ValueError or TypeError. Extra\n"
"bytes in the input are ignored.");
"If no valid value is found, raise EOFError, ValueError or TypeError.\n"
"Extra bytes in the input are ignored.");
#define MARSHAL_LOADS_METHODDEF \
{"loads", _PyCFunction_CAST(marshal_loads), METH_FASTCALL|METH_KEYWORDS, marshal_loads__doc__},
@@ -351,4 +351,4 @@ exit:
return return_value;
}
/*[clinic end generated code: output=3e4bfc070a3c78ac input=a9049054013a1b77]*/
/*[clinic end generated code: output=a574570c3717f60e input=a9049054013a1b77]*/
+12 -11
View File
@@ -1396,7 +1396,8 @@ PyDoc_STRVAR(sys__stats_dump__doc__,
"\n"
"Dump stats to file, and clears the stats.\n"
"\n"
"Return False if no statistics were not dumped because stats gathering was off.");
"Return False if no statistics were not dumped because stats gathering\n"
"was off.");
#define SYS__STATS_DUMP_METHODDEF \
{"_stats_dump", (PyCFunction)sys__stats_dump, METH_NOARGS, sys__stats_dump__doc__},
@@ -1544,16 +1545,16 @@ PyDoc_STRVAR(sys_remote_exec__doc__,
"Executes a file containing Python code in a given remote Python process.\n"
"\n"
"This function returns immediately, and the code will be executed by the\n"
"target process\'s main thread at the next available opportunity, similarly\n"
"to how signals are handled. There is no interface to determine when the\n"
"code has been executed. The caller is responsible for making sure that\n"
"the file still exists whenever the remote process tries to read it and that\n"
"it hasn\'t been overwritten.\n"
"target process\'s main thread at the next available opportunity,\n"
"similarly to how signals are handled. There is no interface to\n"
"determine when the code has been executed. The caller is responsible\n"
"for making sure that the file still exists whenever the remote process\n"
"tries to read it and that it hasn\'t been overwritten.\n"
"\n"
"The remote process must be running a CPython interpreter of the same major\n"
"and minor version as the local process. If either the local or remote\n"
"interpreter is pre-release (alpha, beta, or release candidate) then the\n"
"local and remote interpreters must be the same exact version.\n"
"The remote process must be running a CPython interpreter of the same\n"
"major and minor version as the local process. If either the local or\n"
"remote interpreter is pre-release (alpha, beta, or release candidate)\n"
"then the local and remote interpreters must be the same exact version.\n"
"\n"
"Args:\n"
" pid (int): The process ID of the target Python process.\n"
@@ -1979,4 +1980,4 @@ exit:
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
/*[clinic end generated code: output=9052f399f40ca32d input=a9049054013a1b77]*/
/*[clinic end generated code: output=407915aef6734c56 input=a9049054013a1b77]*/
+18 -15
View File
@@ -620,14 +620,14 @@ _contextvars.Context.get
Return the value for `key` if `key` has the value in the context object.
If `key` does not exist, return `default`. If `default` is not given,
return None.
If `key` does not exist, return `default`. If `default` is not
given, return None.
[clinic start generated code]*/
static PyObject *
_contextvars_Context_get_impl(PyContext *self, PyObject *key,
PyObject *default_value)
/*[clinic end generated code: output=0c54aa7664268189 input=c8eeb81505023995]*/
/*[clinic end generated code: output=0c54aa7664268189 input=d1be897231334ea9]*/
{
if (context_check_key_type(key)) {
return NULL;
@@ -1007,16 +1007,18 @@ _contextvars.ContextVar.get
Return a value for the context variable for the current context.
If there is no value for the variable in the current context, the method will:
* return the value of the default argument of the method, if provided; or
* return the default value for the context variable, if it was created
with one; or
If there is no value for the variable in the current context, the
method will:
* return the value of the default argument of the method, if
provided; or
* return the default value for the context variable, if it was
created with one; or
* raise a LookupError.
[clinic start generated code]*/
static PyObject *
_contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
/*[clinic end generated code: output=0746bd0aa2ced7bf input=30aa2ab9e433e401]*/
/*[clinic end generated code: output=0746bd0aa2ced7bf input=83814c6aef4a9fe3]*/
{
PyObject *val;
if (PyContextVar_Get((PyObject *)self, default_value, &val) < 0) {
@@ -1038,15 +1040,16 @@ _contextvars.ContextVar.set
Call to set a new value for the context variable in the current context.
The required value argument is the new value for the context variable.
The required value argument is the new value for the context
variable.
Returns a Token object that can be used to restore the variable to its previous
value via the `ContextVar.reset()` method.
Returns a Token object that can be used to restore the variable to
its previous value via the `ContextVar.reset()` method.
[clinic start generated code]*/
static PyObject *
_contextvars_ContextVar_set_impl(PyContextVar *self, PyObject *value)
/*[clinic end generated code: output=1b562d35cc79c806 input=c0a6887154227453]*/
/*[clinic end generated code: output=1b562d35cc79c806 input=6ffee66796d67896]*/
{
return PyContextVar_Set((PyObject *)self, value);
}
@@ -1058,13 +1061,13 @@ _contextvars.ContextVar.reset
Reset the context variable.
The variable is reset to the value it had before the `ContextVar.set()` that
created the token was used.
The variable is reset to the value it had before the
`ContextVar.set()` that created the token was used.
[clinic start generated code]*/
static PyObject *
_contextvars_ContextVar_reset_impl(PyContextVar *self, PyObject *token)
/*[clinic end generated code: output=3205d2bdff568521 input=ebe2881e5af4ffda]*/
/*[clinic end generated code: output=3205d2bdff568521 input=dd33cfcb18c00e37]*/
{
if (!PyContextToken_CheckExact(token)) {
PyErr_Format(PyExc_TypeError,
+4 -3
View File
@@ -4328,13 +4328,14 @@ _imp.acquire_lock
Acquires the interpreter's import lock for the current thread.
This lock should be used by import hooks to ensure thread-safety when importing
modules. On platforms without threads, this function does nothing.
This lock should be used by import hooks to ensure thread-safety when
importing modules. On platforms without threads, this function does
nothing.
[clinic start generated code]*/
static PyObject *
_imp_acquire_lock_impl(PyObject *module)
/*[clinic end generated code: output=1aff58cb0ee1b026 input=4a2d4381866d5fdc]*/
/*[clinic end generated code: output=1aff58cb0ee1b026 input=60e9c1b4ab471ead]*/
{
PyInterpreterState *interp = _PyInterpreterState_GET();
_PyImport_AcquireLock(interp);
+6 -6
View File
@@ -2045,14 +2045,14 @@ marshal.dumps
Return the bytes object that would be written to a file by dump(value, file).
Raise a ValueError exception if value has (or contains an object that has) an
unsupported type.
Raise a ValueError exception if value has (or contains an object that
has) an unsupported type.
[clinic start generated code]*/
static PyObject *
marshal_dumps_impl(PyObject *module, PyObject *value, int version,
int allow_code)
/*[clinic end generated code: output=115f90da518d1d49 input=167eaecceb63f0a8]*/
/*[clinic end generated code: output=115f90da518d1d49 input=d9609c4dee4507fb]*/
{
return _PyMarshal_WriteObjectToString(value, version, allow_code);
}
@@ -2068,13 +2068,13 @@ marshal.loads
Convert the bytes-like object to a value.
If no valid value is found, raise EOFError, ValueError or TypeError. Extra
bytes in the input are ignored.
If no valid value is found, raise EOFError, ValueError or TypeError.
Extra bytes in the input are ignored.
[clinic start generated code]*/
static PyObject *
marshal_loads_impl(PyObject *module, Py_buffer *bytes, int allow_code)
/*[clinic end generated code: output=62c0c538d3edc31f input=14de68965b45aaa7]*/
/*[clinic end generated code: output=62c0c538d3edc31f input=286f1dbd6811d2ad]*/
{
RFILE rf;
char *s = bytes->buf;
+13 -12
View File
@@ -2314,12 +2314,13 @@ sys._stats_dump -> bool
Dump stats to file, and clears the stats.
Return False if no statistics were not dumped because stats gathering was off.
Return False if no statistics were not dumped because stats gathering
was off.
[clinic start generated code]*/
static int
sys__stats_dump_impl(PyObject *module)
/*[clinic end generated code: output=6e346b4ba0de4489 input=31a489e39418b2a5]*/
/*[clinic end generated code: output=6e346b4ba0de4489 input=7f3b7758cb59d2ff]*/
{
int res = _Py_PrintSpecializationStats(1);
_Py_StatsClear();
@@ -2463,16 +2464,16 @@ sys.remote_exec
Executes a file containing Python code in a given remote Python process.
This function returns immediately, and the code will be executed by the
target process's main thread at the next available opportunity, similarly
to how signals are handled. There is no interface to determine when the
code has been executed. The caller is responsible for making sure that
the file still exists whenever the remote process tries to read it and that
it hasn't been overwritten.
target process's main thread at the next available opportunity,
similarly to how signals are handled. There is no interface to
determine when the code has been executed. The caller is responsible
for making sure that the file still exists whenever the remote process
tries to read it and that it hasn't been overwritten.
The remote process must be running a CPython interpreter of the same major
and minor version as the local process. If either the local or remote
interpreter is pre-release (alpha, beta, or release candidate) then the
local and remote interpreters must be the same exact version.
The remote process must be running a CPython interpreter of the same
major and minor version as the local process. If either the local or
remote interpreter is pre-release (alpha, beta, or release candidate)
then the local and remote interpreters must be the same exact version.
Args:
pid (int): The process ID of the target Python process.
@@ -2482,7 +2483,7 @@ Args:
static PyObject *
sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
/*[clinic end generated code: output=7d94c56afe4a52c0 input=39908ca2c5fe1eb0]*/
/*[clinic end generated code: output=7d94c56afe4a52c0 input=7bd58f8da20cb74c]*/
{
PyObject *path;
const char *debugger_script_path;