Skip to content

Commit

Permalink
Merge branch 'main' into docs/whatsnew/bytecode
Browse files Browse the repository at this point in the history
# Conflicts:
#	Doc/whatsnew/3.12.rst
  • Loading branch information
AA-Turner committed Sep 27, 2023
2 parents 4bd178d + b35f084 commit 6ddc852
Show file tree
Hide file tree
Showing 77 changed files with 1,528 additions and 818 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
run: .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci

build_win_amd64:
name: 'Windows (x64)'
Expand All @@ -201,7 +201,7 @@ jobs:
- name: Display build info
run: .\python.bat -m test.pythoninfo
- name: Tests
run: .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci

build_win_arm64:
name: 'Windows (arm64)'
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
- name: Display build info
run: make pythoninfo
- name: Tests
run: make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: make test

build_ubuntu:
name: 'Ubuntu'
Expand Down Expand Up @@ -319,7 +319,7 @@ jobs:
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
- name: Tests
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: xvfb-run make test

build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
Expand Down Expand Up @@ -535,7 +535,7 @@ jobs:
- name: Display build info
run: make pythoninfo
- name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
run: xvfb-run make test

all-required-green: # This job does nothing and is only used for the branch protection
name: All required checks pass
Expand Down
5 changes: 3 additions & 2 deletions Doc/library/devmode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ Effects of the Python Development Mode:
``default``.

* Call :func:`faulthandler.enable` at Python startup to install handlers for
the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and
:const:`SIGILL` signals to dump the Python traceback on a crash.
the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`,
:const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and
:const:`~signal.SIGILL` signals to dump the Python traceback on a crash.

It behaves as if the :option:`-X faulthandler <-X>` command line option is
used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to
Expand Down
14 changes: 9 additions & 5 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1381,15 +1381,19 @@ call fails (for example because the path doesn't exist).
>>> p.resolve()
PosixPath('/home/antoine/pathlib/setup.py')

If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError`
is raised. If *strict* is ``False``, the path is resolved as far as possible
and any remainder is appended without checking whether it exists. If an
infinite loop is encountered along the resolution path, :exc:`RuntimeError`
is raised.
If a path doesn't exist or a symlink loop is encountered, and *strict* is
``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is
resolved as far as possible and any remainder is appended without checking
whether it exists.

.. versionchanged:: 3.6
The *strict* parameter was added (pre-3.6 behavior is strict).

.. versionchanged:: 3.13
Symlink loops are treated like other errors: :exc:`OSError` is raised in
strict mode, and no exception is raised in non-strict mode. In previous
versions, :exc:`RuntimeError` is raised no matter the value of *strict*.

.. method:: Path.rglob(pattern, *, case_sensitive=None, follow_symlinks=None)

Glob the given relative *pattern* recursively. This is like calling
Expand Down
6 changes: 6 additions & 0 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ Standard names are defined for the following types:

.. versionadded:: 3.12

.. class:: CapsuleType

The type of :ref:`capsule objects <capsules>`.

.. versionadded:: 3.13


Additional Utility Classes and Functions
----------------------------------------
Expand Down
19 changes: 9 additions & 10 deletions Doc/library/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ See :ref:`__slots__ documentation <slots>` for details.

Exceptions raised by the callback will be noted on the standard error output,
but cannot be propagated; they are handled in exactly the same way as exceptions
raised from an object's :meth:`__del__` method.
raised from an object's :meth:`~object.__del__` method.

Weak references are :term:`hashable` if the *object* is hashable. They will
maintain their hash value even after the *object* was deleted. If
Expand Down Expand Up @@ -221,8 +221,7 @@ than needed.
Added support for ``|`` and ``|=`` operators, as specified in :pep:`584`.

:class:`WeakValueDictionary` objects have an additional method that has the
same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary`
objects.
same issues as the :meth:`WeakKeyDictionary.keyrefs` method.


.. method:: WeakValueDictionary.valuerefs()
Expand Down Expand Up @@ -281,7 +280,7 @@ objects.
Exceptions raised by finalizer callbacks during garbage collection
will be shown on the standard error output, but cannot be
propagated. They are handled in the same way as exceptions raised
from an object's :meth:`__del__` method or a weak reference's
from an object's :meth:`~object.__del__` method or a weak reference's
callback.

When the program exits, each remaining live finalizer is called
Expand Down Expand Up @@ -523,18 +522,18 @@ is still alive. For instance
obj dead or exiting


Comparing finalizers with :meth:`__del__` methods
-------------------------------------------------
Comparing finalizers with :meth:`~object.__del__` methods
---------------------------------------------------------

Suppose we want to create a class whose instances represent temporary
directories. The directories should be deleted with their contents
when the first of the following events occurs:

* the object is garbage collected,
* the object's :meth:`remove` method is called, or
* the object's :meth:`!remove` method is called, or
* the program exits.

We might try to implement the class using a :meth:`__del__` method as
We might try to implement the class using a :meth:`~object.__del__` method as
follows::

class TempDir:
Expand All @@ -553,12 +552,12 @@ follows::
def __del__(self):
self.remove()

Starting with Python 3.4, :meth:`__del__` methods no longer prevent
Starting with Python 3.4, :meth:`~object.__del__` methods no longer prevent
reference cycles from being garbage collected, and module globals are
no longer forced to :const:`None` during :term:`interpreter shutdown`.
So this code should work without any issues on CPython.

However, handling of :meth:`__del__` methods is notoriously implementation
However, handling of :meth:`~object.__del__` methods is notoriously implementation
specific, since it depends on internal details of the interpreter's garbage
collector implementation.

Expand Down
3 changes: 0 additions & 3 deletions Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Doc/library/csv.rst
Doc/library/datetime.rst
Doc/library/dbm.rst
Doc/library/decimal.rst
Doc/library/devmode.rst
Doc/library/difflib.rst
Doc/library/doctest.rst
Doc/library/email.charset.rst
Expand Down Expand Up @@ -133,7 +132,6 @@ Doc/library/unittest.mock.rst
Doc/library/unittest.rst
Doc/library/urllib.parse.rst
Doc/library/urllib.request.rst
Doc/library/weakref.rst
Doc/library/wsgiref.rst
Doc/library/xml.dom.minidom.rst
Doc/library/xml.dom.pulldom.rst
Expand All @@ -154,7 +152,6 @@ Doc/tutorial/controlflow.rst
Doc/tutorial/datastructures.rst
Doc/tutorial/introduction.rst
Doc/using/cmdline.rst
Doc/using/configure.rst
Doc/using/windows.rst
Doc/whatsnew/2.0.rst
Doc/whatsnew/2.1.rst
Expand Down
31 changes: 20 additions & 11 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ General Options

.. cmdoption:: --enable-loadable-sqlite-extensions

Support loadable extensions in the :mod:`_sqlite` extension module (default
is no).
Support loadable extensions in the :mod:`!_sqlite` extension module (default
is no) of the :mod:`sqlite3` module.

See the :meth:`sqlite3.Connection.enable_load_extension` method of the
:mod:`sqlite3` module.
Expand Down Expand Up @@ -198,7 +198,7 @@ General Options
Some Linux distribution packaging policies recommend against bundling
dependencies. For example, Fedora installs wheel packages in the
``/usr/share/python-wheels/`` directory and don't install the
:mod:`ensurepip._bundled` package.
:mod:`!ensurepip._bundled` package.

.. versionadded:: 3.10

Expand Down Expand Up @@ -469,7 +469,7 @@ Install Options
.. cmdoption:: --disable-test-modules

Don't build nor install test modules, like the :mod:`test` package or the
:mod:`_testcapi` extension module (built and installed by default).
:mod:`!_testcapi` extension module (built and installed by default).

.. versionadded:: 3.10

Expand Down Expand Up @@ -615,7 +615,7 @@ Effects of a debug build:
* Display all warnings by default: the list of default warning filters is empty
in the :mod:`warnings` module.
* Add ``d`` to :data:`sys.abiflags`.
* Add :func:`sys.gettotalrefcount` function.
* Add :func:`!sys.gettotalrefcount` function.
* Add :option:`-X showrefcount <-X>` command line option.
* Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment
variable to debug the parser.
Expand All @@ -637,7 +637,7 @@ Effects of a debug build:
* Check that deallocator functions don't change the current exception.
* The garbage collector (:func:`gc.collect` function) runs some basic checks
on objects consistency.
* The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and
* The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and
overflow when downcasting from wide types to narrow types.

See also the :ref:`Python Development Mode <devmode>` and the
Expand All @@ -664,7 +664,7 @@ Debug options
Effects:

* Define the ``Py_TRACE_REFS`` macro.
* Add :func:`sys.getobjects` function.
* Add :func:`!sys.getobjects` function.
* Add :envvar:`PYTHONDUMPREFS` environment variable.

The :envvar:`PYTHONDUMPREFS` environment variable can be used to dump
Expand Down Expand Up @@ -748,7 +748,7 @@ Libraries options

.. cmdoption:: --with-system-expat

Build the :mod:`pyexpat` module using an installed ``expat`` library
Build the :mod:`!pyexpat` module using an installed ``expat`` library
(default is no).

.. cmdoption:: --with-system-libmpdec
Expand Down Expand Up @@ -964,9 +964,18 @@ Main Makefile targets
You can use the configure :option:`--enable-optimizations` option to make
this the default target of the ``make`` command (``make all`` or just
``make``).
* ``make buildbottest``: Build Python and run the Python test suite, the same
way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds)
to change the test timeout (1200 by default: 20 minutes).

* ``make test``: Build Python and run the Python test suite with ``--fast-ci``
option. Variables:

* ``TESTOPTS``: additional regrtest command line options.
* ``TESTPYTHONOPTS``: additional Python command line options.
* ``TESTTIMEOUT``: timeout in seconds (default: 20 minutes).

* ``make buildbottest``: Similar to ``make test``, but use ``--slow-ci``
option and default timeout of 20 minutes, instead of ``--fast-ci`` option
and a default timeout of 10 minutes.

* ``make install``: Build and install Python.
* ``make regen-all``: Regenerate (almost) all generated files;
``make regen-stdlib-module-names`` and ``autoconf`` must be run separately
Expand Down
Loading

0 comments on commit 6ddc852

Please sign in to comment.