Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-81079-glob-case-sensitive-arg-2
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed May 2, 2023
2 parents dc82494 + 65a49c6 commit c411cfa
Show file tree
Hide file tree
Showing 158 changed files with 2,898 additions and 833 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/documentation-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Read the Docs PR preview
# Automatically edits a pull request's descriptions with a link
# to the documentation's preview on Read the Docs.

on:
pull_request_target:
types:
- opened
paths:
- 'Doc/**'
- '.github/workflows/doc.yml'

permissions:
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "cpython-previews"
single-version: "true"
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file sets the canonical name for contributors to the repository.
# Documentation: https://git-scm.com/docs/gitmailmap
Amethyst Reese <[email protected]> <[email protected]>
18 changes: 18 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Project page: https://readthedocs.org/projects/cpython-previews/

version: 2

sphinx:
configuration: Doc/conf.py

build:
os: ubuntu-22.04
tools:
python: "3"

commands:
- make -C Doc venv html
- mkdir _readthedocs
- mv Doc/build/html _readthedocs/html
21 changes: 20 additions & 1 deletion Doc/c-api/gcsupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,31 @@ rules:
Analogous to :c:func:`PyObject_New` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
.. c:function:: TYPE* PyObject_GC_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size)
Analogous to :c:func:`PyObject_NewVar` but for container objects with the
:const:`Py_TPFLAGS_HAVE_GC` flag set.
.. c:function:: PyObject* PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *type, size_t extra_size)
Analogous to :c:func:`PyObject_GC_New` but allocates *extra_size*
bytes at the end of the object (at offset
:c:member:`~PyTypeObject.tp_basicsize`).
The allocated memory is initialized to zeros,
except for the :c:type:`Python object header <PyObject>`.
The extra data will be deallocated with the object, but otherwise it is
not managed by Python.
.. warning::
The function is marked as unstable because the final mechanism
for reserving extra data after an instance is not yet decided.
For allocating a variable number of fields, prefer using
:c:type:`PyVarObject` and :c:member:`~PyTypeObject.tp_itemsize`
instead.
.. versionadded:: 3.12
.. c:function:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize)
Expand Down
35 changes: 27 additions & 8 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@
# Short title used e.g. for <title> HTML tags.
html_short_title = '%s Documentation' % release

# Deployment preview information, from Netlify
# (See netlify.toml and https://docs.netlify.com/configure-builds/environment-variables/#git-metadata)
# Deployment preview information
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL")
html_context = {
"is_deployment_preview": os.getenv("IS_DEPLOYMENT_PREVIEW"),
"repository_url": os.getenv("REPOSITORY_URL"),
"pr_id": os.getenv("REVIEW_ID")
"is_deployment_preview": os.getenv("READTHEDOCS_VERSION_TYPE") == "external",
"repository_url": repository_url.removesuffix(".git") if repository_url else None,
"pr_id": os.getenv("READTHEDOCS_VERSION")
}

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
Expand Down Expand Up @@ -263,11 +264,29 @@

linkcheck_allowed_redirects = {
# bpo-NNNN -> BPO -> GH Issues
r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': 'https://github.com/python/cpython/issues/\d+',
r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': r'https://github.com/python/cpython/issues/\d+',
# GH-NNNN used to refer to pull requests
r'https://github.com/python/cpython/issues/\d+': 'https://github.com/python/cpython/pull/\d+',
r'https://github.com/python/cpython/issues/\d+': r'https://github.com/python/cpython/pull/\d+',
# :source:`something` linking files in the repository
r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*'
r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*',
# Intentional HTTP use at Misc/NEWS.d/3.5.0a1.rst
r'http://www.python.org/$': 'https://www.python.org/$',
# Used in license page, keep as is
r'https://www.zope.org/': r'https://www.zope.dev/',
# Microsoft's redirects to learn.microsoft.com
r'https://msdn.microsoft.com/.*': 'https://learn.microsoft.com/.*',
r'https://docs.microsoft.com/.*': 'https://learn.microsoft.com/.*',
r'https://go.microsoft.com/fwlink/\?LinkID=\d+': 'https://learn.microsoft.com/.*',
# Language redirects
r'https://toml.io': 'https://toml.io/en/',
r'https://www.redhat.com': 'https://www.redhat.com/en',
# Other redirects
r'https://www.boost.org/libs/.+': r'https://www.boost.org/doc/libs/\d_\d+_\d/.+',
r'https://support.microsoft.com/en-us/help/\d+': 'https://support.microsoft.com/en-us/topic/.+',
r'https://perf.wiki.kernel.org$': 'https://perf.wiki.kernel.org/index.php/Main_Page',
r'https://www.sqlite.org': 'https://www.sqlite.org/index.html',
r'https://mitpress.mit.edu/sicp$': 'https://mitpress.mit.edu/9780262510875/structure-and-interpretation-of-computer-programs/',
r'https://www.python.org/psf/': 'https://www.python.org/psf-landing/',
}

linkcheck_anchors_ignore = [
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ on what you're trying to do.
.. XXX make sure these all work
`Cython <https://cython.org>`_ and its relative `Pyrex
<https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are compilers
<https://www.csse.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are compilers
that accept a slightly modified form of Python and generate the corresponding
C code. Cython and Pyrex make it possible to write an extension without having
to learn Python's C API.
Expand Down
8 changes: 4 additions & 4 deletions Doc/faq/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ commercial use, to sell copies of Python in source or binary form (modified or
unmodified), or to sell products that incorporate Python in some form. We would
still like to know about all commercial use of Python, of course.

See `the PSF license page <https://www.python.org/psf/license/>`_ to find further
explanations and a link to the full text of the license.
See `the license page <https://docs.python.org/3/license.html>`_ to find further
explanations and the full text of the PSF License.

The Python logo is trademarked, and in certain cases permission is required to
use it. Consult `the Trademark Usage Policy
Expand Down Expand Up @@ -215,7 +215,7 @@ every day, and Usenet readers are often more able to cope with this volume.
Announcements of new software releases and events can be found in
comp.lang.python.announce, a low-traffic moderated list that receives about five
postings per day. It's available as `the python-announce mailing list
<https://mail.python.org/mailman/listinfo/python-announce-list>`_.
<https://mail.python.org/mailman3/lists/python-announce-list.python.org/>`_.

More info about other mailing lists and newsgroups
can be found at https://www.python.org/community/lists/.
Expand Down Expand Up @@ -352,7 +352,7 @@ titled "Python X.Y Release Schedule", where X.Y is a version that hasn't been
publicly released yet.

New development is discussed on `the python-dev mailing list
<https://mail.python.org/mailman/listinfo/python-dev/>`_.
<https://mail.python.org/mailman3/lists/python-dev.python.org/>`_.


Is it reasonable to propose incompatible changes to Python?
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Yes.
`Pyflakes <https://github.com/PyCQA/pyflakes>`_ do basic checking that will
help you catch bugs sooner.

Static type checkers such as `Mypy <http://mypy-lang.org/>`_,
Static type checkers such as `Mypy <https://mypy-lang.org/>`_,
`Pyre <https://pyre-check.org/>`_, and
`Pytype <https://github.com/google/pytype>`_ can check type hints in Python
source code.
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/pyporting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ to make sure everything functions as expected in both versions of Python.
.. _Futurize: https://python-future.org/automatic_conversion.html
.. _importlib2: https://pypi.org/project/importlib2
.. _Modernize: https://python-modernize.readthedocs.io/
.. _mypy: http://mypy-lang.org/
.. _mypy: https://mypy-lang.org/
.. _Porting to Python 3: http://python3porting.com/
.. _Pylint: https://pypi.org/project/pylint

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ Opening network connections
specifies requirements for algorithms that reduce this user-visible
delay and provides an algorithm.

For more information: https://tools.ietf.org/html/rfc6555
For more information: https://datatracker.ietf.org/doc/html/rfc6555

.. versionchanged:: 3.11

Expand Down
36 changes: 36 additions & 0 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,42 @@ Running Tasks Concurrently
and there is no running event loop.


Eager Task Factory
==================

.. function:: eager_task_factory(loop, coro, *, name=None, context=None)

A task factory for eager task execution.

When using this factory (via :meth:`loop.set_task_factory(asyncio.eager_task_factory) <loop.set_task_factory>`),
coroutines begin execution synchronously during :class:`Task` construction.
Tasks are only scheduled on the event loop if they block.
This can be a performance improvement as the overhead of loop scheduling
is avoided for coroutines that complete synchronously.

A common example where this is beneficial is coroutines which employ
caching or memoization to avoid actual I/O when possible.

.. note::

Immediate execution of the coroutine is a semantic change.
If the coroutine returns or raises, the task is never scheduled
to the event loop. If the coroutine execution blocks, the task is
scheduled to the event loop. This change may introduce behavior
changes to existing applications. For example,
the application's task execution order is likely to change.

.. versionadded:: 3.12

.. function:: create_eager_task_factory(custom_task_constructor)

Create an eager task factory, similar to :func:`eager_task_factory`,
using the provided *custom_task_constructor* when creating a new task instead
of the default :class:`Task`.

.. versionadded:: 3.12


Shielding From Cancellation
===========================

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/copyreg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Such constructors may be factory functions or class instances.

Declares that *function* should be used as a "reduction" function for objects
of type *type*. *function* must return either a string or a tuple
containing two or five elements. See the :attr:`~pickle.Pickler.dispatch_table`
containing between two and six elements. See the :attr:`~pickle.Pickler.dispatch_table`
for more details on the interface of *function*.

The *constructor_ob* parameter is a legacy feature and is now ignored, but if
Expand Down
12 changes: 6 additions & 6 deletions Doc/library/hashlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Constructor functions also accept the following tree hashing parameters:
:alt: Explanation of tree mode parameters.

See section 2.10 in `BLAKE2 specification
<https://blake2.net/blake2_20130129.pdf>`_ for comprehensive review of tree
<https://www.blake2.net/blake2_20130129.pdf>`_ for comprehensive review of tree
hashing.


Expand Down Expand Up @@ -619,7 +619,7 @@ on the hash function used in digital signatures.
by the signer.

(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
<https://csrc.nist.gov/publications/detail/sp/800-106/final>`_)
<https://csrc.nist.gov/publications/detail/sp/800-106/archive/2009-02-25>`_)

In BLAKE2 the salt is processed as a one-time input to the hash function during
initialization, rather than as an input to each compression function.
Expand All @@ -628,7 +628,7 @@ initialization, rather than as an input to each compression function.

*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose
cryptographic hash function, such as SHA-256, is not suitable for hashing
passwords. See `BLAKE2 FAQ <https://blake2.net/#qa>`_ for more
passwords. See `BLAKE2 FAQ <https://www.blake2.net/#qa>`_ for more
information.
..
Expand Down Expand Up @@ -764,9 +764,9 @@ Domain Dedication 1.0 Universal:

* *Alexandr Sokolovskiy*

.. _BLAKE2: https://blake2.net
.. _BLAKE2: https://www.blake2.net
.. _HMAC: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code
.. _BLAKE: https://131002.net/blake/
.. _BLAKE: https://web.archive.org/web/20200918190133/https://131002.net/blake/
.. _SHA-3: https://en.wikipedia.org/wiki/NIST_hash_function_competition
.. _ChaCha: https://cr.yp.to/chacha.html
.. _pyblake2: https://pythonhosted.org/pyblake2/
Expand All @@ -782,7 +782,7 @@ Domain Dedication 1.0 Universal:
Module :mod:`base64`
Another way to encode binary hashes for non-binary environments.

https://blake2.net
https://www.blake2.net
Official BLAKE2 website.

https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/documents/fips180-2.pdf
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/http.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ HTTPConnection Objects
the CONNECT request.

As HTTP/1.1 is used for HTTP CONNECT tunnelling request, `as per the RFC
<https://tools.ietf.org/html/rfc7231#section-4.3.6>`_, a HTTP ``Host:``
<https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.6>`_, a HTTP ``Host:``
header must be provided, matching the authority-form of the request target
provided as the destination for the CONNECT request. If a HTTP ``Host:``
header is not provided via the headers argument, one is generated and
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/importlib.metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The "selectable" entry points were introduced in ``importlib_metadata``
no parameters and always returned a dictionary of entry points, keyed
by group. With ``importlib_metadata`` 5.0 and Python 3.12,
``entry_points`` always returns an ``EntryPoints`` object. See
`backports.entry_points_selectable <https://pypi.org/project/backports.entry_points_selectable>`_
`backports.entry_points_selectable <https://pypi.org/project/backports.entry-points-selectable>`_
for compatibility options.


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4593,7 +4593,7 @@ written in Python, such as a mail server's external command delivery program.
:attr:`!children_system`, and :attr:`!elapsed` in that order.

See the Unix manual page
:manpage:`times(2)` and `times(3) <https://www.freebsd.org/cgi/man.cgi?time(3)>`_ manual page on Unix or `the GetProcessTimes MSDN
:manpage:`times(2)` and `times(3) <https://man.freebsd.org/cgi/man.cgi?time(3)>`_ manual page on Unix or `the GetProcessTimes MSDN
<https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocesstimes>`_
on Windows. On Windows, only :attr:`!user` and :attr:`!system` are known; the other attributes are zero.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/plistlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ or :class:`datetime.datetime` objects.

.. seealso::

`PList manual page <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/>`_
`PList manual page <https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/PropertyLists/>`_
Apple's documentation of the file format.


Expand Down
2 changes: 1 addition & 1 deletion Doc/library/resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ platform.
used by all of this user id's processes.
This limit is enforced only if bit 1 of the vm.overcommit sysctl is set.
Please see
`tuning(7) <https://www.freebsd.org/cgi/man.cgi?query=tuning&sektion=7>`__
`tuning(7) <https://man.freebsd.org/cgi/man.cgi?query=tuning&sektion=7>`__
for a complete description of this sysctl.

.. availability:: FreeBSD.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ Kqueue Objects
Kevent Objects
--------------

https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2

.. attribute:: kevent.ident

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ to speed up repeated connections from the same clients.
.. versionadded:: 3.3

.. seealso::
`SSL/TLS & Perfect Forward Secrecy <https://vincent.bernat.im/en/blog/2011-ssl-perfect-forward-secrecy>`_
`SSL/TLS & Perfect Forward Secrecy <https://vincent.bernat.ch/en/blog/2011-ssl-perfect-forward-secrecy>`_
Vincent Bernat.

.. method:: SSLContext.wrap_socket(sock, server_side=False, \
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This module provides functions for calculating mathematical statistics of
numeric (:class:`~numbers.Real`-valued) data.

The module is not intended to be a competitor to third-party libraries such
as `NumPy <https://numpy.org>`_, `SciPy <https://www.scipy.org/>`_, or
as `NumPy <https://numpy.org>`_, `SciPy <https://scipy.org/>`_, or
proprietary full-featured statistics packages aimed at professional
statisticians such as Minitab, SAS and Matlab. It is aimed at the level of
graphing and scientific calculators.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/struct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,4 +602,4 @@ The :mod:`struct` module also defines the following type:

.. _ieee 754 standard: https://en.wikipedia.org/wiki/IEEE_754-2008_revision

.. _IETF RFC 1700: https://tools.ietf.org/html/rfc1700
.. _IETF RFC 1700: https://datatracker.ietf.org/doc/html/rfc1700
2 changes: 1 addition & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ always available.
additional garbage collector overhead if the object is managed by the garbage
collector.

See `recursive sizeof recipe <https://code.activestate.com/recipes/577504>`_
See `recursive sizeof recipe <https://code.activestate.com/recipes/577504/>`_
for an example of using :func:`getsizeof` recursively to find the size of
containers and all their contents.

Expand Down
Loading

0 comments on commit c411cfa

Please sign in to comment.