Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into split_tier2_opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Nov 6, 2023
2 parents 326cb74 + ba8aa1f commit 2a0edf9
Show file tree
Hide file tree
Showing 282 changed files with 25,193 additions and 33,491 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ jobs:
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
with:
allowed-failures: >-
build_macos,
build_macos_free_threaded,
build_ubuntu_free_threaded,
build_ubuntu_ssltests,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/new-bugs-announce-notifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
- run: npm install mailgun.js form-data
- name: Send notification
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion Doc/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ though it may take a while to be processed.
`Helping with Documentation <https://devguide.python.org/docquality/#helping-with-documentation>`_
Comprehensive guide for individuals that are interested in contributing to Python documentation.

`Documentation Translations <https://devguide.python.org/documenting/#translating>`_
`Documentation Translations <https://devguide.python.org/documentation/translating/>`_
A list of GitHub pages for documentation translation and their primary contacts.


Expand Down
1 change: 1 addition & 0 deletions Doc/c-api/bytes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ called with a non-bytes parameter.
Return the null-terminated contents of the object *obj*
through the output variables *buffer* and *length*.
Returns ``0`` on success.
If *length* is ``NULL``, the bytes object
may not contain embedded null bytes;
Expand Down
4 changes: 4 additions & 0 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ it can be updated:
>>> Movie('Star Wars').director
'J.J. Abrams'

.. testcleanup::

conn.close()


Pure Python Equivalents
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 5 additions & 3 deletions Doc/library/difflib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
expressed in the ISO 8601 format. If not specified, the
strings default to blanks.

>>> import sys
>>> from difflib import *
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py'))
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py',
... tofile='after.py'))
*** before.py
--- after.py
***************
Expand Down Expand Up @@ -294,13 +297,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
For inputs that do not have trailing newlines, set the *lineterm* argument to
``""`` so that the output will be uniformly newline free.

The context diff format normally has a header for filenames and modification
The unified diff format normally has a header for filenames and modification
times. Any or all of these may be specified using strings for *fromfile*,
*tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
expressed in the ISO 8601 format. If not specified, the
strings default to blanks.


>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py'))
Expand Down
14 changes: 12 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ iterations of the loop.
.. versionchanged:: 3.12
oparg set to be the exception block depth, for efficient closing of generators.

.. versionchanged:: 3.13
oparg is ``1`` if this instruction is part of a yield-from or await, and ``0``
otherwise.

.. opcode:: SETUP_ANNOTATIONS

Expand Down Expand Up @@ -1625,20 +1628,27 @@ iterations of the loop.
success (``True``) or failure (``False``).


.. opcode:: RESUME (where)
.. opcode:: RESUME (context)

A no-op. Performs internal tracing, debugging and optimization checks.

The ``where`` operand marks where the ``RESUME`` occurs:
The ``context`` oparand consists of two parts. The lowest two bits
indicate where the ``RESUME`` occurs:

* ``0`` The start of a function, which is neither a generator, coroutine
nor an async generator
* ``1`` After a ``yield`` expression
* ``2`` After a ``yield from`` expression
* ``3`` After an ``await`` expression

The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0``
otherwise.

.. versionadded:: 3.11

.. versionchanged:: 3.13
The oparg value changed to include information about except-depth


.. opcode:: RETURN_GENERATOR

Expand Down
7 changes: 7 additions & 0 deletions Doc/library/ipaddress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ write code that handles both IP versions correctly. Address objects are
``True`` if the address is reserved for link-local usage. See
:RFC:`3927`.

.. attribute:: ipv6_mapped

:class:`IPv4Address` object representing the IPv4-mapped IPv6 address. See :RFC:`4291`.

.. versionadded:: 3.13


.. _iana-ipv4-special-registry: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
.. _iana-ipv6-special-registry: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml

Expand Down
4 changes: 1 addition & 3 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,7 @@ supports sending logging messages to a remote or local Unix syslog.
to the other end. This method is called during handler initialization,
but it's not regarded as an error if the other end isn't listening at
this point - the method will be called again when emitting an event, if
but it's not regarded as an error if the other end isn't listening yet
--- the method will be called again when emitting an event,
if there is no socket at that point.
there is no socket at that point.

.. versionadded:: 3.11

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ can be overridden by the local file.

Create an alias called *name* that executes *command*. The *command* must
*not* be enclosed in quotes. Replaceable parameters can be indicated by
``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters.
``%1``, ``%2``, ... and ``%9``, while ``%*`` is replaced by all the parameters.
If *command* is omitted, the current alias for *name* is shown. If no
arguments are given, all aliases are listed.

Expand Down
175 changes: 165 additions & 10 deletions Doc/library/tkinter.messagebox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,184 @@

The :mod:`tkinter.messagebox` module provides a template base class as well as
a variety of convenience methods for commonly used configurations. The message
boxes are modal and will return a subset of (True, False, OK, None, Yes, No) based on
boxes are modal and will return a subset of (``True``, ``False``, ``None``,
:data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on
the user's selection. Common message box styles and layouts include but are not
limited to:

.. figure:: tk_msg.png

.. class:: Message(master=None, **options)

Create a default information message box.
Create a message window with an application-specified message, an icon
and a set of buttons.
Each of the buttons in the message window is identified by a unique symbolic name (see the *type* options).

The following options are supported:

*command*
Specifies the function to invoke when the user closes the dialog.
The name of the button clicked by the user to close the dialog is
passed as argument.
This is only available on macOS.

*default*
Gives the :ref:`symbolic name <messagebox-buttons>` of the default button
for this message window (:data:`OK`, :data:`CANCEL`, and so on).
If this option is not specified, the first button in the dialog will
be made the default.

*detail*
Specifies an auxiliary message to the main message given by the
*message* option.
The message detail will be presented beneath the main message and,
where supported by the OS, in a less emphasized font than the main
message.

*icon*
Specifies an :ref:`icon <messagebox-icons>` to display.
If this option is not specified, then the :data:`INFO` icon will be
displayed.

*message*
Specifies the message to display in this message box.
The default value is an empty string.

*parent*
Makes the specified window the logical parent of the message box.
The message box is displayed on top of its parent window.

*title*
Specifies a string to display as the title of the message box.
This option is ignored on macOS, where platform guidelines forbid
the use of a title on this kind of dialog.

*type*
Arranges for a :ref:`predefined set of buttons <messagebox-types>`
to be displayed.

.. method:: show(**options)

Display a message window and wait for the user to select one of the buttons. Then return the symbolic name of the selected button.
Keyword arguments can override options specified in the constructor.


**Information message box**

.. method:: showinfo(title=None, message=None, **options)
.. function:: showinfo(title=None, message=None, **options)

Creates and displays an information message box with the specified title
and message.

**Warning message boxes**

.. method:: showwarning(title=None, message=None, **options)
showerror(title=None, message=None, **options)
.. function:: showwarning(title=None, message=None, **options)

Creates and displays a warning message box with the specified title
and message.

.. function:: showerror(title=None, message=None, **options)

Creates and displays an error message box with the specified title
and message.

**Question message boxes**

.. method:: askquestion(title=None, message=None, **options)
askokcancel(title=None, message=None, **options)
askretrycancel(title=None, message=None, **options)
askyesno(title=None, message=None, **options)
askyesnocancel(title=None, message=None, **options)
.. function:: askquestion(title=None, message=None, *, type=YESNO, **options)

Ask a question. By default shows buttons :data:`YES` and :data:`NO`.
Returns the symbolic name of the selected button.

.. function:: askokcancel(title=None, message=None, **options)

Ask if operation should proceed. Shows buttons :data:`OK` and :data:`CANCEL`.
Returns ``True`` if the answer is ok and ``False`` otherwise.

.. function:: askretrycancel(title=None, message=None, **options)

Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:`CANCEL`.
Return ``True`` if the answer is yes and ``False`` otherwise.

.. function:: askyesno(title=None, message=None, **options)

Ask a question. Shows buttons :data:`YES` and :data:`NO`.
Returns ``True`` if the answer is yes and ``False`` otherwise.

.. function:: askyesnocancel(title=None, message=None, **options)

Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`.
Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False``
otherwise.


.. _messagebox-buttons:

Symbolic names of buttons:

.. data:: ABORT
:value: 'abort'
.. data:: RETRY
:value: 'retry'
.. data:: IGNORE
:value: 'ignore'
.. data:: OK
:value: 'ok'
.. data:: CANCEL
:value: 'cancel'
.. data:: YES
:value: 'yes'
.. data:: NO
:value: 'no'

.. _messagebox-types:

Predefined sets of buttons:

.. data:: ABORTRETRYIGNORE
:value: 'abortretryignore'

Displays three buttons whose symbolic names are :data:`ABORT`,
:data:`RETRY` and :data:`IGNORE`.

.. data:: OK
:value: 'ok'
:noindex:

Displays one button whose symbolic name is :data:`OK`.

.. data:: OKCANCEL
:value: 'okcancel'

Displays two buttons whose symbolic names are :data:`OK` and
:data:`CANCEL`.

.. data:: RETRYCANCEL
:value: 'retrycancel'

Displays two buttons whose symbolic names are :data:`RETRY` and
:data:`CANCEL`.

.. data:: YESNO
:value: 'yesno'

Displays two buttons whose symbolic names are :data:`YES` and
:data:`NO`.

.. data:: YESNOCANCEL
:value: 'yesnocancel'

Displays three buttons whose symbolic names are :data:`YES`,
:data:`NO` and :data:`CANCEL`.

.. _messagebox-icons:

Icon images:

.. data:: ERROR
:value: 'error'
.. data:: INFO
:value: 'info'
.. data:: QUESTION
:value: 'question'
.. data:: WARNING
:value: 'warning'
8 changes: 4 additions & 4 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ without the dedicated syntax, as documented below.

.. doctest::

>>> from typing import ParamSpec
>>> from typing import ParamSpec, get_origin
>>> P = ParamSpec("P")
>>> get_origin(P.args) is P
True
Expand Down Expand Up @@ -3059,14 +3059,14 @@ Introspection helpers

Return the set of members defined in a :class:`Protocol`.

::
.. doctest::

>>> from typing import Protocol, get_protocol_members
>>> class P(Protocol):
... def a(self) -> str: ...
... b: int
>>> get_protocol_members(P)
frozenset({'a', 'b'})
>>> get_protocol_members(P) == frozenset({'a', 'b'})
True

Raise :exc:`TypeError` for arguments that are not Protocols.

Expand Down
4 changes: 2 additions & 2 deletions Doc/tools/templates/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ <h2>Unpacking</h2>

<p>Unix users should download the .tar.bz2 archives; these are bzipped tar
archives and can be handled in the usual way using tar and the bzip2
program. The <a href="http://www.info-zip.org">InfoZIP</a> unzip program can be
program. The <a href="https://infozip.sourceforge.net">Info-ZIP</a> unzip program can be
used to handle the ZIP archives if desired. The .tar.bz2 archives provide the
best compression and fastest download times.</p>

<p>Windows users can use the ZIP archives since those are customary on that
platform. These are created on Unix using the InfoZIP zip program.</p>
platform. These are created on Unix using the Info-ZIP zip program.</p>


<h2>Problems</h2>
Expand Down
Loading

0 comments on commit 2a0edf9

Please sign in to comment.