Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Modules/_abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,14 +915,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));
Expand Down
28 changes: 15 additions & 13 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,12 +955,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;
Expand Down Expand Up @@ -1095,15 +1096,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) {
Expand Down Expand Up @@ -1252,15 +1253,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)
Expand Down Expand Up @@ -1292,13 +1293,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;
Expand Down Expand Up @@ -3844,6 +3845,7 @@ _asyncio__leave_task_impl(PyObject *module, PyObject *loop, PyObject *task)


/*[clinic input]
@permit_long_summary
_asyncio._swap_current_task

loop: object
Expand All @@ -3858,7 +3860,7 @@ This is intended for use during eager coroutine execution.
static PyObject *
_asyncio__swap_current_task_impl(PyObject *module, PyObject *loop,
PyObject *task)
/*[clinic end generated code: output=9f88de958df74c7e input=c9c72208d3d38b6c]*/
/*[clinic end generated code: output=9f88de958df74c7e input=ec14ed25855e3068]*/
{
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
return swap_current_task(ts, loop, task);
Expand Down
12 changes: 6 additions & 6 deletions Modules/_bisectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,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.
Expand All @@ -169,7 +169,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=b476bc45667273ac]*/
/*[clinic end generated code: output=3a4bc09cc7c8a73d input=27717afe1a61bfaa]*/
{
return internal_bisect_right(a, x, lo, hi, key);
}
Expand Down Expand Up @@ -338,8 +338,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.
Expand All @@ -350,7 +350,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=9b4d49b5ddecfad7]*/
/*[clinic end generated code: output=70749d6e5cae9284 input=259fedbe35e882e1]*/
{
return internal_bisect_left(a, x, lo, hi, key);
}
Expand Down
24 changes: 12 additions & 12 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,32 +577,32 @@ decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
}

/*[clinic input]
@permit_long_docstring_body
_bz2.BZ2Decompressor.decompress
data: Py_buffer
max_length: Py_ssize_t=-1
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=3703e78f91757655]*/
/*[clinic end generated code: output=23e41045deb240a3 input=7f68faa9ff7a1b51]*/
{
PyObject *result = NULL;

Expand Down
42 changes: 22 additions & 20 deletions Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -116,16 +117,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();
Expand All @@ -143,16 +144,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();
Expand Down Expand Up @@ -962,14 +963,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;
Expand Down Expand Up @@ -1007,13 +1009,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);
}
Expand Down
3 changes: 2 additions & 1 deletion Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ _deque_rotate(dequeobject *deque, Py_ssize_t n)
}

/*[clinic input]
@permit_long_summary
@critical_section
_collections.deque.rotate as deque_rotate
Expand All @@ -1089,7 +1090,7 @@ Rotate the deque n steps to the right. If n is negative, rotates left.

static PyObject *
deque_rotate_impl(dequeobject *deque, Py_ssize_t n)
/*[clinic end generated code: output=96c2402a371eb15d input=5bf834296246e002]*/
/*[clinic end generated code: output=96c2402a371eb15d input=3543c3b2297de8f1]*/
{
if (!_deque_rotate(deque, n))
Py_RETURN_NONE;
Expand Down
Loading
Loading