Skip to content

Commit 285efe2

Browse files
Merge branch 'main' into support-async-breakpoint
2 parents 1b77cdb + 4b15d10 commit 285efe2

File tree

110 files changed

+1279
-619
lines changed

Some content is hidden

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

110 files changed

+1279
-619
lines changed

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
611611
Note that the :c:member:`~PyVarObject.ob_size` field may later be used for
612612
other purposes. For example, :py:type:`int` instances use the bits of
613613
:c:member:`~PyVarObject.ob_size` in an implementation-defined
614-
way; the underlying storage and its size should be acessed using
614+
way; the underlying storage and its size should be accessed using
615615
:c:func:`PyLong_Export`.
616616

617617
.. note::

Doc/c-api/unicode.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,14 @@ APIs:
596596
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
597597
598598
599+
.. c:function:: PyObject* PyUnicode_FromOrdinal(int ordinal)
600+
601+
Create a Unicode Object from the given Unicode code point *ordinal*.
602+
603+
The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is
604+
raised in the case it is not.
605+
606+
599607
.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
600608
const char *encoding, const char *errors)
601609
@@ -622,7 +630,7 @@ APIs:
622630
623631
On error, set *\*p_left* to ``NULL`` and set an exception.
624632
625-
On sucess, set *\*p_left* to a new strong reference to the result.
633+
On success, set *\*p_left* to a new strong reference to the result.
626634
627635
628636
.. c:function:: void PyUnicode_AppendAndDel(PyObject **p_left, PyObject *right)

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1:
27702770
PyUnicode_FromFormatV:const char*:format::
27712771
PyUnicode_FromFormatV:va_list:args::
27722772

2773+
PyUnicode_FromOrdinal:PyObject*::+1:
2774+
PyUnicode_FromOrdinal:int:ordinal::
2775+
27732776
PyUnicode_Append:void:::
27742777
PyUnicode_Append:PyObject**:p_left:0:
27752778
PyUnicode_Append:PyObject*:right::

Doc/library/annotationlib.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Functions
214214

215215
Convert an annotations dict containing runtime values to a
216216
dict containing only strings. If the values are not already strings,
217-
they are converted using :func:`value_to_string`.
217+
they are converted using :func:`type_repr`.
218218
This is meant as a helper for user-provided
219219
annotate functions that support the :attr:`~Format.STRING` format but
220220
do not have access to the code creating the annotations.
@@ -317,11 +317,22 @@ Functions
317317
Compute the annotations dict for an object.
318318

319319
*obj* may be a callable, class, module, or other object with
320-
:attr:`~object.__annotate__` and :attr:`~object.__annotations__` attributes.
321-
Passing in an object of any other type raises :exc:`TypeError`.
320+
:attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes.
321+
Passing any other object raises :exc:`TypeError`.
322322

323323
The *format* parameter controls the format in which annotations are returned,
324324
and must be a member of the :class:`Format` enum or its integer equivalent.
325+
The different formats work as follows:
326+
327+
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
328+
the :attr:`!object.__annotate__` function is called if it exists.
329+
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
330+
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it
331+
does not exist either, :attr:`!object.__annotations__` is tried again and any error
332+
from accessing it is re-raised.
333+
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
334+
otherwise, :attr:`!object.__annotations__` is used and stringified
335+
using :func:`annotations_to_string`.
325336

326337
Returns a dict. :func:`!get_annotations` returns a new dict every time
327338
it's called; calling it twice on the same object will return two
@@ -382,7 +393,7 @@ Functions
382393

383394
.. versionadded:: 3.14
384395

385-
.. function:: value_to_string(value)
396+
.. function:: type_repr(value)
386397

387398
Convert an arbitrary Python value to a format suitable for use by the
388399
:attr:`~Format.STRING` format. This calls :func:`repr` for most

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,8 @@ Allows customizing how exceptions are handled in the event loop.
14401440
* 'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;
14411441
* 'transport' (optional): :ref:`Transport <asyncio-transport>` instance;
14421442
* 'socket' (optional): :class:`socket.socket` instance;
1443+
* 'source_traceback' (optional): Traceback of the source;
1444+
* 'handle_traceback' (optional): Traceback of the handle;
14431445
* 'asyncgen' (optional): Asynchronous generator that caused
14441446
the exception.
14451447

Doc/library/asyncio-future.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ Future Functions
5151

5252
.. important::
5353

54-
See also the :func:`create_task` function which is the
55-
preferred way for creating new Tasks.
56-
5754
Save a reference to the result of this function, to avoid
5855
a task disappearing mid-execution.
5956

57+
See also the :func:`create_task` function which is the
58+
preferred way for creating new tasks or use :class:`asyncio.TaskGroup`
59+
which keeps reference to the task internally.
60+
6061
.. versionchanged:: 3.5.1
6162
The function accepts any :term:`awaitable` object.
6263

Doc/library/asyncio-task.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,10 @@ Task Object
13811381

13821382
Request the Task to be cancelled.
13831383

1384-
This arranges for a :exc:`CancelledError` exception to be thrown
1384+
If the Task is already *done* or *cancelled*, return ``False``,
1385+
otherwise, return ``True``.
1386+
1387+
The method arranges for a :exc:`CancelledError` exception to be thrown
13851388
into the wrapped coroutine on the next cycle of the event loop.
13861389

13871390
The coroutine then has a chance to clean up or even deny the

Doc/library/audit_events.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,30 @@ information on handling these events.
2323
The following events are raised internally and do not correspond to any
2424
public API of CPython:
2525

26-
+--------------------------+-------------------------------------------+
27-
| Audit event | Arguments |
28-
+==========================+===========================================+
29-
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30-
| | ``share_mode``, ``creation_disposition``, |
31-
| | ``flags_and_attributes`` |
32-
+--------------------------+-------------------------------------------+
33-
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34-
+--------------------------+-------------------------------------------+
35-
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36-
+--------------------------+-------------------------------------------+
37-
| _winapi.CreatePipe | |
38-
+--------------------------+-------------------------------------------+
39-
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40-
| | ``current_directory`` |
41-
+--------------------------+-------------------------------------------+
42-
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43-
+--------------------------+-------------------------------------------+
44-
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45-
+--------------------------+-------------------------------------------+
46-
| ctypes.PyObj_FromPtr | ``obj`` |
47-
+--------------------------+-------------------------------------------+
26+
+----------------------------+-------------------------------------------+
27+
| Audit event | Arguments |
28+
+============================+===========================================+
29+
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30+
| | ``share_mode``, ``creation_disposition``, |
31+
| | ``flags_and_attributes`` |
32+
+----------------------------+-------------------------------------------+
33+
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34+
+----------------------------+-------------------------------------------+
35+
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36+
+----------------------------+-------------------------------------------+
37+
| _winapi.CreatePipe | |
38+
+----------------------------+-------------------------------------------+
39+
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40+
| | ``current_directory`` |
41+
+----------------------------+-------------------------------------------+
42+
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43+
+----------------------------+-------------------------------------------+
44+
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45+
+----------------------------+-------------------------------------------+
46+
| _posixsubprocess.fork_exec | ``exec_list``, ``args``, ``env`` |
47+
+----------------------------+-------------------------------------------+
48+
| ctypes.PyObj_FromPtr | ``obj`` |
49+
+----------------------------+-------------------------------------------+
50+
51+
.. versionadded:: next
52+
The ``_posixsubprocess.fork_exec`` internal audit event.

Doc/library/codecs.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ any codec:
5555

5656
The full details for each codec can also be looked up directly:
5757

58-
.. function:: lookup(encoding)
58+
.. function:: lookup(encoding, /)
5959

6060
Looks up the codec info in the Python codec registry and returns a
6161
:class:`CodecInfo` object as defined below.
@@ -156,7 +156,7 @@ these additional functions which use :func:`lookup` for the codec lookup:
156156
Custom codecs are made available by registering a suitable codec search
157157
function:
158158

159-
.. function:: register(search_function)
159+
.. function:: register(search_function, /)
160160

161161
Register a codec search function. Search functions are expected to take one
162162
argument, being the encoding name in all lower case letters with hyphens
@@ -168,7 +168,7 @@ function:
168168
Hyphens and spaces are converted to underscore.
169169

170170

171-
.. function:: unregister(search_function)
171+
.. function:: unregister(search_function, /)
172172

173173
Unregister a codec search function and clear the registry's cache.
174174
If the search function is not registered, do nothing.
@@ -416,7 +416,7 @@ In addition, the following error handler is specific to the given codecs:
416416
The set of allowed values can be extended by registering a new named error
417417
handler:
418418

419-
.. function:: register_error(name, error_handler)
419+
.. function:: register_error(name, error_handler, /)
420420

421421
Register the error handling function *error_handler* under the name *name*.
422422
The *error_handler* argument will be called during encoding and decoding
@@ -442,7 +442,7 @@ handler:
442442
Previously registered error handlers (including the standard error handlers)
443443
can be looked up by name:
444444

445-
.. function:: lookup_error(name)
445+
.. function:: lookup_error(name, /)
446446

447447
Return the error handler previously registered under the name *name*.
448448

Doc/library/ctypes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,8 @@ in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:
17791779

17801780
.. audit-event:: ctypes.call_function func_pointer,arguments foreign-functions
17811781

1782-
Some ways to invoke foreign function calls may raise an auditing event
1782+
Some ways to invoke foreign function calls as well as some of the
1783+
functions in this module may raise an auditing event
17831784
``ctypes.call_function`` with arguments ``function pointer`` and ``arguments``.
17841785

17851786
.. _ctypes-function-prototypes:

0 commit comments

Comments
 (0)