8000 Pull in main · python/cpython@f72c5e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit f72c5e9

Browse files
Pull in main
2 parents 661cd7a + d0160c7 commit f72c5e9

File tree

392 files changed

+7295
-5688
lines changed
  • test_peg_generator
  • test_sqlite3
  • test_tools
  • typinganndata
  • xml/dom
  • Misc
  • Modules
  • Some content is hidden

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

    392 files changed

    +7295
    -5688
    lines changed

    .github/workflows/mypy.yml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -9,6 +9,7 @@ on:
    99
    paths:
    1010
    - "Tools/clinic/**"
    1111
    - "Tools/cases_generator/**"
    12+
    - "Tools/requirements-dev.txt"
    1213
    - ".github/workflows/mypy.yml"
    1314
    workflow_dispatch:
    1415

    Doc/c-api/dict.rst

    Lines changed: 16 additions & 4 deletions
    < 10000 tr class="diff-line-row">
    Original file line numberDiff line numberDiff line change
    @@ -55,6 +55,15 @@ Dictionary Objects
    5555
    This is equivalent to the Python expression ``key in p``.
    5656
    5757
    58+
    .. c:function:: int PyDict_ContainsString(PyObject *p, const char *key)
    59+
    60+
    This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a
    61+
    :c:expr:`const char*` UTF-8 encoded bytes string, rather than a
    62+
    :c:expr:`PyObject*`.
    63+
    64+
    .. versionadded:: 3.13
    65+
    66+
    5867
    .. c:function:: PyObject* PyDict_Copy(PyObject *p)
    5968
    6069
    Return a new dictionary that contains the same key-value pairs as *p*.
    @@ -73,7 +82,7 @@ Dictionary Objects
    7382
    .. index:: single: PyUnicode_FromString()
    7483
    7584
    Insert *val* into the dictionary *p* using *key* as a key. *key* should
    76-
    be a :c:expr:`const char*`. The key object is created using
    85+
    be a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is created using
    7786
    ``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on
    7887
    failure. This function *does not* steal a reference to *val*.
    7988
    @@ -88,7 +97,8 @@ Dictionary Objects
    8897
    8998
    .. c:function:: int PyDict_DelItemString(PyObject *p, const char *key)
    9099
    91-
    Remove the entry in dictionary *p* which has a key specified by the string *key*.
    100+
    Remove the entry in dictionary *p* which has a key specified by the UTF-8
    101+
    encoded bytes string *key*.
    92102
    If *key* is not in the dictionary, :exc:`KeyError` is raised.
    93103
    Return ``0`` on success or ``-1`` on failure.
    94104
    @@ -136,7 +146,8 @@ Dictionary Objects
    136146
    .. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
    137147
    138148
    This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
    139-
    :c:expr:`const char*`, rather than a :c:expr:`PyObject*`.
    149+
    :c:expr:`const char*` UTF-8 encoded bytes string, rather than a
    150+
    :c:expr:`PyObject*`.
    140151
    141152
    .. note::
    142153
    @@ -150,7 +161,8 @@ Dictionary Objects
    150161
    .. c:function:: int PyDict_GetItemStringRef(PyObject *p, const char *key, PyObject **result)
    151162
    152163
    Similar than :c:func:`PyDict_GetItemRef`, but *key* is specified as a
    153-
    :c:expr:`const char*`, rather than a :c:expr:`PyObject*`.
    164+
    :c:expr:`const char*` UTF-8 encoded bytes string, rather than a
    165+
    :c:expr:`PyObject*`.
    154166
    155167
    .. versionadded:: 3.13
    156168

    Doc/c-api/long.rst

    Lines changed: 8 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -136,6 +136,14 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
    136136
    This function will no longer use :meth:`~object.__int__`.
    137137
    138138
    139+
    .. c:function:: int PyLong_AsInt(PyObject *obj)
    140+
    141+
    Similar to :c:func:`PyLong_AsLong`, but store the result in a C
    142+
    :c:expr:`int` instead of a C :c:expr:`long`.
    143+
    144+
    .. versionadded:: 3.13
    145+
    146+
    139147
    .. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)
    140148
    141149
    Return a C :c:expr:`long` representation of *obj*. If *obj* is not an

    Doc/c-api/typeobj.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1403,7 +1403,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
    14031403
    are allowed to be removed even if the instance is still alive).
    14041404

    14051405
    Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to
    1406-
    :c:func:`local_traverse` to have these specific names; don't name them just
    1406+
    :c:func:`!local_traverse` to have these specific names; don't name them just
    14071407
    anything.
    14081408

    14091409
    Instances of :ref:`heap-allocated types <heap-types>` hold a reference to

    Doc/data/stable_abi.dat

    Lines changed: 1 addition & 0 deletions
    Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

    Doc/howto/pyporting.rst

    Lines changed: 94 additions & 121 deletions
    Large diffs are not rendered by default.

    Doc/library/asyncio-task.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -592,7 +592,7 @@ Shielding From Cancellation
    592592

    593593
    is equivalent to::
    594594

    595-
    res = await something()
    595+
    res = await shield(something())
    596596

    597597
    *except* that if the coroutine containing it is cancelled, the
    598598
    Task running in ``something()`` is not cancelled. From the point

    Doc/library/calendar.rst

    Lines changed: 23 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -469,6 +469,29 @@ The :mod:`calendar` module exports the following data attributes:
    469469

    470470
    Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``.
    471471

    472+
    473+
    The :mod:`calendar` module defines the following exceptions:
    474+
    475+
    .. exception:: IllegalMonthError(month)
    476+
    477+
    A subclass of :exc:`ValueError`,
    478+
    raised when the given month number is outside of the range 1-12 (inclusive).
    479+
    480+
    .. attribute:: month
    481+
    482+
    The invalid month number.
    483+
    484+
    485+
    .. exception:: IllegalWeekdayError(weekday)
    486+
    487+
    A subclass of :exc:`ValueError`,
    488+
    raised when the given weekday number is outside of the range 0-6 (inclusive).
    489+
    490+
    .. attribute:: weekday
    491+
    492+
    The invalid weekday number.
    493+
    494+
    472495
    .. seealso::
    473496

    474497
    Module :mod:`datetime`

    Doc/library/dis.rst

    Lines changed: 24 additions & 11 deletions
    Original file line numberDiff line numberDiff line change
    @@ -43,13 +43,13 @@ interpreter.
    4343
    adaptive bytecode can be shown by passing ``adaptive=True``.
    4444

    4545

    46-
    Example: Given the function :func:`myfunc`::
    46+
    Example: Given the function :func:`!myfunc`::
    4747

    4848
    def myfunc(alist):
    4949
    return len(alist)
    5050

    5151
    the following command can be used to display the disassembly of
    52-
    :func:`myfunc`:
    52+
    :func:`!myfunc`:
    5353

    5454
    .. doctest::
    5555

    @@ -297,6 +297,9 @@ operation is being performed, so the intermediate analysis object isn't useful:
    297297
    The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno``
    298298
    and ``co_lnotab`` attributes of the code object.
    299299

    300+
    .. versionchanged:: 3.13
    301+
    Line numbers can be ``None`` for bytecode that does not map to source lines.
    302+
    300303

    301304
    .. function:: findlabels(code)
    302305

    @@ -402,7 +405,12 @@ details of bytecode instructions as :class:`Instruction` instances:
    402405

    403406
    .. data:: starts_line
    404407

    405-
    line started by this opcode (if any), otherwise ``None``
    408+
    ``True`` if this opcode starts a source line, otherwise ``False``
    409+
    410+
    411+
    .. data:: line_number
    412+
    413+
    source line number associated with this opcode (if any), otherwise ``None``
    406414

    407415

    408416
    .. data:: is_jump_target
    @@ -429,8 +437,11 @@ details of bytecode instructions as :class:`Instruction` instances:
    429437

    430438
    .. versionchanged:: 3.13
    431439

    440+
    Changed field ``starts_line``.
    441+
    432442
    Added fields ``start_offset``, ``cache_offset``, ``end_offset``,
    433-
    ``baseopname``, ``baseopcode``, ``jump_target`` and ``oparg``.
    443+
    ``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, and
    444+
    ``line_number``.
    434445

    435446

    436447
    .. class:: Positions
    @@ -851,7 +862,7 @@ iterations of the loop.
    851862

    852863
    .. opcode:: LOAD_BUILD_CLASS
    853864

    854-
    Pushes :func:`builtins.__build_class__` onto the stack. It is later called
    865+
    Pushes :func:`!builtins.__build_class__` onto the stack. It is later called
    855866
    to construct a class.
    856867

    857868

    @@ -909,14 +920,14 @@ iterations of the loop.
    909920
    .. opcode:: STORE_NAME (namei)
    910921

    911922
    Implements ``name = STACK.pop()``. *namei* is the index of *name* in the attribute
    912-
    :attr:`co_names` of the code object. The compiler tries to use
    913-
    :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible.
    923+
    :attr:`!co_names` of the :ref:`code object <code-objects>`.
    924+
    The compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible.
    914925

    915926

    916927
    .. opcode:: DELETE_NAME (namei)
    917928

    918-
    Implements ``del name``, where *namei* is the index into :attr:`co_names`
    919-
    attribute of the code object.
    929+
    Implements ``del name``, where *namei* is the index into :attr:`!co_names`
    930+
    attribute of the :ref:`code object <code-objects>`.
    920931

    921932

    922933
    .. opcode:: UNPACK_SEQUENCE (count)
    @@ -955,7 +966,8 @@ iterations of the loop.
    955966
    value = STACK.pop()
    956967
    obj.name = value
    957968

    958-
    where *namei* is the index of name in :attr:`co_names`.
    969+
    where *namei* is the index of name in :attr:`!co_names` of the
    970+
    :ref:`code object <code-objects>`.
    959971

    960972
    .. opcode:: DELETE_ATTR (namei)
    961973

    @@ -964,7 +976,8 @@ iterations of the loop.
    964976
    obj = STACK.pop()
    965977
    del obj.name
    966978

    967-
    where *namei* is the index of name into :attr:`co_names`.
    979+
    where *namei* is the index of name into :attr:`!co_names` of the
    980+
    :ref:`code object <code-objects>`.
    968981

    969982

    970983
    .. opcode:: STORE_GLOBAL (namei)

    Doc/library/errno.rst

    Lines changed: 28 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -511,6 +511,13 @@ defined by the module. The specific list of defined symbols is available as
    511511
    Operation not supported on transport endpoint
    512512

    513513

    514+
    .. data:: ENOTSUP
    515+
    516+
    Operation not supported
    517+
    518+
    .. versionadded:: 3.2
    519+
    520+
    514521
    .. data:: EPFNOSUPPORT
    515522

    516523
    Protocol family not supported
    @@ -666,3 +673,24 @@ defined by the module. The specific list of defined symbols is available as
    666673
    .. availability:: WASI, FreeBSD
    667674

    668675
    .. versionadded:: 3.11.1
    676+
    677+
    678+
    .. data:: ECANCELED
    679+
    680+
    Operation canceled
    681+
    682+
    .. versionadded:: 3.2
    683+
    684+
    685+
    .. data:: EOWNERDEAD
    686+
    687+
    Owner died
    688+
    689+
    .. versionadded:: 3.2
    690+
    691+
    692+
    .. data:: ENOTRECOVERABLE
    693+
    694+
    State not recoverable
    695+
    696+
    .. versionadded:: 3.2

    Doc/library/io.rst

    Lines changed: 9 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1054,13 +1054,21 @@ Text I/O
    10541054

    10551055
    * ``seek(0, SEEK_SET)``: Rewind to the start of the stream.
    10561056
    * ``seek(cookie, SEEK_SET)``: Restore a previous position;
    1057-
    *cookie* **must be** a number returned by :meth:`!tell`.
    1057+
    *cookie* **must be** a number returned by :meth:`tell`.
    10581058
    * ``seek(0, SEEK_END)``: Fast-forward to the end of the stream.
    10591059
    * ``seek(0, SEEK_CUR)``: Leave the current stream position unchanged.
    10601060

    10611061
    Any other argument combinations are invalid,
    10621062
    and may raise exceptions.
    10631063

    1064+
    .. method:: tell()
    1065+
    1066+
    Return the stream position as an opaque number.
    1067+
    The return value of :meth:`!tell` can be given as input to :meth:`seek`,
    1068+
    to restore a previous stream position.
    1069+
    1070+
    1071+
    10641072
    .. class:: StringIO(initial_value='', newline='\n')
    10651073

    10661074
    A text stream using an in-memory text buffer. It inherits

    Doc/library/logging.config.rst

    Lines changed: 2 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -685,7 +685,8 @@ resolve to ``'dev_team@domain.tld'`` and the string
    685685
    ``'support_team@domain.tld'``. The ``subject`` value could be accessed
    686686
    using either ``'cfg://handlers.email.subject'`` or, equivalently,
    687687
    ``'cfg://handlers.email[subject]'``. The latter form only needs to be
    688-
    used if the key contains spaces or non-alphanumeric characters. If an
    688+
    used if the key contains spaces or non-alphanumeric characters. Please note
    689+
    that the characters ``[`` and ``]`` are not allowed in the keys. If an
    689690
    index value consists only of decimal digits, access will be attempted
    690691
    using the corresponding integer value, falling back to the string
    691692
    value if needed.

    0 commit comments

    Comments
     (0)
    0