Skip to content

Commit 88d9da8

Browse files
authored
Merge branch 'main' into getrandom_use_NR
2 parents 5748e10 + bc6749c commit 88d9da8

47 files changed

Lines changed: 824 additions & 245 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/extending/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ Finally it should be mentioned that Capsules offer additional functionality,
11061106
which is especially useful for memory allocation and deallocation of the pointer
11071107
stored in a Capsule. The details are described in the Python/C API Reference
11081108
Manual in the section :ref:`capsules` and in the implementation of Capsules (files
1109-
:file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` in the Python source
1109+
:file:`Include/pycapsule.h` and :file:`Objects/capsule.c` in the Python source
11101110
code distribution).
11111111

11121112
.. rubric:: Footnotes

Doc/library/annotationlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ Functions
235235
annotate functions that support the :attr:`~Format.STRING` format but
236236
do not have access to the code creating the annotations.
237237

238-
For example, this is used to implement the :attr:`~Format.STRING` for
239-
:class:`typing.TypedDict` classes created through the functional syntax:
238+
For example, this is used to implement the :attr:`~Format.STRING` format
239+
for :class:`typing.TypedDict` classes created through the functional syntax:
240240

241241
.. doctest::
242242

Doc/library/compression.zstd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ Compressing and decompressing data in memory
346346
will be set to ``True``.
347347

348348
Attempting to decompress data after the end of a frame will raise a
349-
:exc:`ZstdError`. Any data found after the end of the frame is ignored
349+
:exc:`EOFError`. Any data found after the end of the frame is ignored
350350
and saved in the :attr:`~.unused_data` attribute.
351351

352352
.. attribute:: eof

Doc/library/io.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,13 @@ than raw I/O does.
763763

764764
.. note::
765765
As long as the view exists, the :class:`BytesIO` object cannot be
766-
resized or closed.
766+
resized. Closing it does not invalidate the view.
767767

768768
.. versionadded:: 3.2
769769

770+
.. versionchanged:: next
771+
The :class:`BytesIO` object can now be closed while the view exists.
772+
770773
.. method:: getvalue()
771774

772775
Return :class:`bytes` containing the entire contents of the buffer.

Doc/library/sqlite3.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,10 @@ Blob objects
17601760

17611761
.. versionadded:: 3.11
17621762

1763+
.. versionchanged:: next
1764+
:class:`Blob` now supports negative-step slices
1765+
(e.g. ``blob[9:0:-2]``) for both reading and writing.
1766+
17631767
A :class:`Blob` instance is a :term:`file-like object`
17641768
that can read and write data in an SQLite :abbr:`BLOB (Binary Large OBject)`.
17651769
Call :func:`len(blob) <len>` to get the size (number of bytes) of the blob.

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
19411941
The interpreter is about to execute a new line of code or re-execute the
19421942
condition of a loop. The local trace function is called; *arg* is
19431943
``None``; the return value specifies the new local trace function. See
1944-
:file:`Objects/lnotab_notes.txt` for a detailed explanation of how this
1944+
:source:`InternalDocs/code_objects.md` for a detailed explanation of how this
19451945
works.
19461946
Per-line events may be disabled for a frame by setting
19471947
:attr:`~frame.f_trace_lines` to :const:`False` on that

Doc/library/time.rst

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,24 @@ An explanation of some terminology and conventions is in order.
122122
Functions
123123
---------
124124

125-
.. function:: asctime([t])
125+
.. function:: asctime([time_tuple])
126126

127127
Convert a tuple or :class:`struct_time` representing a time as returned by
128128
:func:`gmtime` or :func:`localtime` to a string of the following
129129
form: ``'Sun Jun 20 23:21:05 1993'``. The day field is two characters long
130130
and is space padded if the day is a single digit,
131-
e.g.: ``'Wed Jun 9 04:26:40 1993'``.
131+
for example: ``'Wed Jun 9 04:26:40 1993'``.
132132

133-
If *t* is not provided, the current time as returned by :func:`localtime`
134-
is used. Locale information is not used by :func:`asctime`.
133+
If *time_tuple* is not provided,
134+
the current time as returned by :func:`localtime` is used.
135+
Locale information is not used by :func:`asctime`.
135136

136137
.. note::
137138

138139
Unlike the C function of the same name, :func:`asctime` does not add a
139140
trailing newline.
140141

141-
.. function:: pthread_getcpuclockid(thread_id)
142+
.. function:: pthread_getcpuclockid(thread_id, /)
142143

143144
Return the *clk_id* of the thread-specific CPU-time clock for the specified *thread_id*.
144145

@@ -157,7 +158,7 @@ Functions
157158

158159
.. versionadded:: 3.7
159160

160-
.. function:: clock_getres(clk_id)
161+
.. function:: clock_getres(clk_id, /)
161162

162163
Return the resolution (precision) of the specified clock *clk_id*. Refer to
163164
:ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
@@ -167,7 +168,7 @@ Functions
167168
.. versionadded:: 3.3
168169

169170

170-
.. function:: clock_gettime(clk_id) -> float
171+
.. function:: clock_gettime(clk_id, /) -> float
171172

172173
Return the time of the specified clock *clk_id*. Refer to
173174
:ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
@@ -180,7 +181,7 @@ Functions
180181
.. versionadded:: 3.3
181182

182183

183-
.. function:: clock_gettime_ns(clk_id) -> int
184+
.. function:: clock_gettime_ns(clk_id, /) -> int
184185

185186
Similar to :func:`clock_gettime` but return time as nanoseconds.
186187

@@ -189,7 +190,7 @@ Functions
189190
.. versionadded:: 3.7
190191

191192

192-
.. function:: clock_settime(clk_id, time)
193+
.. function:: clock_settime(clk_id, time, /)
193194

194195
Set the time of the specified clock *clk_id*. Currently,
195196
:data:`CLOCK_REALTIME` is the only accepted value for *clk_id*.
@@ -205,7 +206,7 @@ Functions
205206
Accepts any real number as *time*, not only integer or float.
206207

207208

208-
.. function:: clock_settime_ns(clk_id, time: int)
209+
.. function:: clock_settime_ns(clk_id, time: int, /)
209210

210211
Similar to :func:`clock_settime` but set time with nanoseconds.
211212

@@ -214,23 +215,23 @@ Functions
214215
.. versionadded:: 3.7
215216

216217

217-
.. function:: ctime([secs])
218+
.. function:: ctime(seconds=None, /)
218219

219220
Convert a time expressed in seconds since the epoch_ to a string of a form:
220221
``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field
221222
is two characters long and is space padded if the day is a single digit,
222-
e.g.: ``'Wed Jun 9 04:26:40 1993'``.
223+
for example: ``'Wed Jun 9 04:26:40 1993'``.
223224

224-
If *secs* is not provided or :const:`None`, the current time as
225-
returned by :func:`.time` is used. ``ctime(secs)`` is equivalent to
226-
``asctime(localtime(secs))``. Locale information is not used by
225+
If *seconds* is not provided or :const:`None`, the current time as
226+
returned by :func:`.time` is used. ``ctime(seconds)`` is equivalent to
227+
``asctime(localtime(seconds))``. Locale information is not used by
227228
:func:`ctime`.
228229

229230
.. versionchanged:: 3.15
230231
Accepts any real number, not only integer or float.
231232

232233

233-
.. function:: get_clock_info(name)
234+
.. function:: get_clock_info(name, /)
234235

235236
Get information on the specified clock as a namespace object.
236237
Supported clock names and the corresponding functions to read their value
@@ -255,10 +256,10 @@ Functions
255256
.. versionadded:: 3.3
256257

257258

258-
.. function:: gmtime([secs])
259+
.. function:: gmtime(seconds=None, /)
259260

260261
Convert a time expressed in seconds since the epoch_ to a :class:`struct_time` in
261-
UTC in which the dst flag is always zero. If *secs* is not provided or
262+
UTC in which the dst flag is always zero. If *seconds* is not provided or
262263
:const:`None`, the current time as returned by :func:`.time` is used. Fractions
263264
of a second are ignored. See above for a description of the
264265
:class:`struct_time` object. See :func:`calendar.timegm` for the inverse of this
@@ -268,11 +269,12 @@ Functions
268269
Accepts any real number, not only integer or float.
269270

270271

271-
.. function:: localtime([secs])
272+
.. function:: localtime(seconds=None, /)
272273

273-
Like :func:`gmtime` but converts to local time. If *secs* is not provided or
274-
:const:`None`, the current time as returned by :func:`.time` is used. The dst
275-
flag is set to ``1`` when DST applies to the given time.
274+
Like :func:`gmtime` but converts to local time.
275+
If *seconds* is not provided or :const:`None`,
276+
the current time as returned by :func:`.time` is used.
277+
The dst flag is set to ``1`` when DST applies to the given time.
276278

277279
:func:`localtime` may raise :exc:`OverflowError`, if the timestamp is
278280
outside the range of values supported by the platform C :c:func:`localtime`
@@ -284,7 +286,7 @@ Functions
284286
Accepts any real number, not only integer or float.
285287

286288

287-
.. function:: mktime(t)
289+
.. function:: mktime(time_tuple, /)
288290

289291
This is the inverse function of :func:`localtime`. Its argument is the
290292
:class:`struct_time` or full 9-tuple (since the dst flag is needed; use ``-1``
@@ -391,7 +393,7 @@ Functions
391393

392394
.. versionadded:: 3.7
393395

394-
.. function:: sleep(secs)
396+
.. function:: sleep(seconds, /)
395397

396398
Suspend execution of the calling thread for the given number of seconds.
397399
The argument may be a non-integer to indicate a more precise sleep time.
@@ -404,13 +406,16 @@ Functions
404406

405407
.. rubric:: Windows implementation
406408

407-
On Windows, if *secs* is zero, the thread relinquishes the remainder of its
408-
time slice to any other thread that is ready to run. If there are no other
409-
threads ready to run, the function returns immediately, and the thread
410-
continues execution. On Windows 10 and newer the implementation uses
409+
On Windows, if *seconds* is zero,
410+
the thread relinquishes the remainder of its time slice
411+
to any other thread that is ready to run.
412+
If there are no other threads ready to run,
413+
the function returns immediately, and the thread continues execution.
414+
On Windows 10 and newer the implementation uses
411415
a `high-resolution timer
412416
<https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-createwaitabletimerexw>`_
413-
which provides resolution of 100 nanoseconds. If *secs* is zero, ``Sleep(0)`` is used.
417+
which provides resolution of 100 nanoseconds.
418+
If *seconds* is zero, ``Sleep(0)`` is used.
414419

415420
.. rubric:: Unix implementation
416421

@@ -425,12 +430,13 @@ Functions
425430
To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling
426431
policy <os-scheduling-policy>` and use :func:`os.sched_yield` instead.
427432

428-
.. audit-event:: time.sleep secs
433+
.. audit-event:: time.sleep seconds
429434

430435
.. versionchanged:: 3.5
431-
The function now sleeps at least *secs* even if the sleep is interrupted
432-
by a signal, except if the signal handler raises an exception (see
433-
:pep:`475` for the rationale).
436+
The function now sleeps at least *seconds*
437+
even if the sleep is interrupted by a signal,
438+
except if the signal handler raises an exception
439+
(see :pep:`475` for the rationale).
434440

435441
.. versionchanged:: 3.11
436442
On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now
@@ -445,13 +451,13 @@ Functions
445451
.. index::
446452
single: % (percent); datetime format
447453

448-
.. function:: strftime(format[, t])
454+
.. function:: strftime(format[, time_tuple])
449455

450456
Convert a tuple or :class:`struct_time` representing a time as returned by
451457
:func:`gmtime` or :func:`localtime` to a string as specified by the *format*
452-
argument. If *t* is not provided, the current time as returned by
458+
argument. If *time_tuple* is not provided, the current time as returned by
453459
:func:`localtime` is used. *format* must be a string. :exc:`ValueError` is
454-
raised if any field in *t* is outside of the allowed range.
460+
raised if any field in *time_tuple* is outside of the allowed range.
455461

456462
0 is a legal argument for any position in the time tuple; if it is normally
457463
illegal the value is forced to a correct one.

Doc/using/android.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ much easier experience:
3737
* `Termux <https://termux.dev/en/>`__
3838

3939
If you're sure you want to do all of this manually, read on. You can use the
40-
:source:`testbed app <Android/testbed>` as a guide; each step below contains a
40+
:source:`testbed app <Platforms/Android/testbed>` as a guide; each step below contains a
4141
link to the relevant file.
4242

4343
* First, acquire a build of Python for Android:
@@ -47,10 +47,10 @@ link to the relevant file.
4747
mentioned below is at the top level of the package.
4848

4949
* Or if you want to build it yourself, follow the instructions in
50-
:source:`Android/README.md`. The ``prefix`` directory will be created under
50+
:source:`Platforms/Android/README.md`. The ``prefix`` directory will be created under
5151
:samp:`cross-build/{HOST}`.
5252

53-
* Add code to your :source:`build.gradle <Android/testbed/app/build.gradle.kts>`
53+
* Add code to your :source:`build.gradle <Platforms/Android/testbed/app/build.gradle.kts>`
5454
file to copy the following items into your project. All except your own Python
5555
code can be copied from ``prefix/lib``:
5656

@@ -65,10 +65,10 @@ link to the relevant file.
6565
* ``python*.*/site-packages`` (your own Python code)
6666

6767
* Add code to your app to :source:`extract the assets to the filesystem
68-
<Android/testbed/app/src/main/java/org/python/testbed/MainActivity.kt>`.
68+
<Platforms/Android/testbed/app/src/main/java/org/python/testbed/MainActivity.kt>`.
6969

7070
* Add code to your app to :source:`start Python in embedded mode
71-
<Android/testbed/app/src/main/c/main_activity.c>`. This will need to be C code
71+
<Platforms/Android/testbed/app/src/main/c/main_activity.c>`. This will need to be C code
7272
called via JNI.
7373

7474
Building a Python package for Android

0 commit comments

Comments
 (0)