Skip to content

Commit

Permalink
Merge branch 'main' into zipfile/compression/plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Jan 11, 2024
2 parents 41d28bd + fafb327 commit 2e128e2
Show file tree
Hide file tree
Showing 242 changed files with 7,486 additions and 11,748 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ jobs:
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Check Autoconf and aclocal versions
run: |
grep "Generated by GNU Autoconf 2.71" configure
Expand Down Expand Up @@ -284,6 +286,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Configure CPython
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython
Expand Down Expand Up @@ -327,6 +331,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
Expand Down Expand Up @@ -446,6 +452,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Configure CPython
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
- name: Build CPython
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/[email protected]
with:
save: ${{ github.event_name == 'push' }}
- name: Setup directory envs for out-of-tree builds
run: |
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
Expand Down
5 changes: 2 additions & 3 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ Object Protocol
.. c:function:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name)
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
always succeeds.
Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise.
This function always succeeds.
.. note::
Expand Down
7 changes: 7 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,13 @@ PyObject_Call:PyObject*:callable_object:0:
PyObject_Call:PyObject*:args:0:
PyObject_Call:PyObject*:kw:0:

PyObject_CallNoArgs:PyObject*::+1:
PyObject_CallNoArgs:PyObject*:callable_object:0:

PyObject_CallOneArg:PyObject*::+1:
PyObject_CallOneArg:PyObject*:callable_object:0:
PyObject_CallOneArg:PyObject*:arg:0:

PyObject_CallFunction:PyObject*::+1:
PyObject_CallFunction:PyObject*:callable_object:0:
PyObject_CallFunction:const char*:format::
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ on the key and a per-process seed; for example, ``'Python'`` could hash to
to ``1142331976``. The hash code is then used to calculate a location in an
internal array where the value will be stored. Assuming that you're storing
keys that all have different hash values, this means that dictionaries take
constant time -- O(1), in Big-O notation -- to retrieve a key.
constant time -- *O*\ (1), in Big-O notation -- to retrieve a key.


Why must dictionary keys be immutable?
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ Glossary
list
A built-in Python :term:`sequence`. Despite its name it is more akin
to an array in other languages than to a linked list since access to
elements is O(1).
elements is *O*\ (1).

list comprehension
A compact way to process all or part of the elements in a sequence and
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ instance::
<function D.f at 0x00C45070>

>>> d.f.__self__
<__main__.D object at 0x1012e1f98>
<__main__.D object at 0x00B18C90>

If you have ever wondered where *self* comes from in regular methods or where
*cls* comes from in class methods, this is it!
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ implementation used by the asyncio event loop:

It works reliably even when the asyncio event loop is run in a non-main OS thread.

There is no noticeable overhead when handling a big number of children (*O(1)* each
There is no noticeable overhead when handling a big number of children (*O*\ (1) each
time a child terminates), but starting a thread per process requires extra memory.

This watcher is used by default.
Expand All @@ -257,7 +257,7 @@ implementation used by the asyncio event loop:
watcher is installed.

The solution is safe but it has a significant overhead when
handling a big number of processes (*O(n)* each time a
handling a big number of processes (*O*\ (*n*) each time a
:py:data:`SIGCHLD` is received).

.. versionadded:: 3.8
Expand All @@ -273,7 +273,7 @@ implementation used by the asyncio event loop:
The watcher avoids disrupting other code spawning processes
by polling every process explicitly on a :py:data:`SIGCHLD` signal.

This solution is as safe as :class:`MultiLoopChildWatcher` and has the same *O(N)*
This solution is as safe as :class:`MultiLoopChildWatcher` and has the same *O*\ (*n*)
complexity but requires a running event loop in the main thread to work.

.. deprecated:: 3.12
Expand All @@ -285,7 +285,7 @@ implementation used by the asyncio event loop:
processes and waiting for their termination.

There is no noticeable overhead when handling a big number of
children (*O(1)* each time a child terminates).
children (*O*\ (1) each time a child terminates).

This solution requires a running event loop in the main thread to work, as
:class:`SafeChildWatcher`.
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/bisect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The following functions are provided:
To support inserting records in a table, the *key* function (if any) is
applied to *x* for the search step but not for the insertion step.

Keep in mind that the ``O(log n)`` search is dominated by the slow O(n)
Keep in mind that the *O*\ (log *n*) search is dominated by the slow *O*\ (*n*)
insertion step.

.. versionchanged:: 3.10
Expand All @@ -99,7 +99,7 @@ The following functions are provided:
To support inserting records in a table, the *key* function (if any) is
applied to *x* for the search step but not for the insertion step.

Keep in mind that the ``O(log n)`` search is dominated by the slow O(n)
Keep in mind that the *O*\ (log *n*) search is dominated by the slow *O*\ (*n*)
insertion step.

.. versionchanged:: 3.10
Expand All @@ -115,7 +115,7 @@ thoughts in mind:
* Bisection is effective for searching ranges of values.
For locating specific values, dictionaries are more performant.

* The *insort()* functions are ``O(n)`` because the logarithmic search step
* The *insort()* functions are *O*\ (*n*) because the logarithmic search step
is dominated by the linear time insertion step.

* The search functions are stateless and discard key function results after
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ or subtracting from an empty counter.
Deques are a generalization of stacks and queues (the name is pronounced "deck"
and is short for "double-ended queue"). Deques support thread-safe, memory
efficient appends and pops from either side of the deque with approximately the
same O(1) performance in either direction.
same *O*\ (1) performance in either direction.

Though :class:`list` objects support similar operations, they are optimized for
fast fixed-length operations and incur O(n) memory movement costs for
fast fixed-length operations and incur *O*\ (*n*) memory movement costs for
``pop(0)`` and ``insert(0, v)`` operations which change both the size and
position of the underlying data representation.

Expand Down Expand Up @@ -585,7 +585,7 @@ or subtracting from an empty counter.
In addition to the above, deques support iteration, pickling, ``len(d)``,
``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with
the :keyword:`in` operator, and subscript references such as ``d[0]`` to access
the first element. Indexed access is O(1) at both ends but slows to O(n) in
the first element. Indexed access is *O*\ (1) at both ends but slows to *O*\ (*n*) in
the middle. For fast random access, use lists instead.

Starting in version 3.5, deques support ``__add__()``, ``__mul__()``,
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Manual Context Management
ctx: Context = copy_context()
print(list(ctx.items()))

The function has an O(1) complexity, i.e. works equally fast for
The function has an *O*\ (1) complexity, i.e. works equally fast for
contexts with a few context variables and for contexts that have
a lot of them.

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ searched. Objects imported into the module are not searched.
In addition, there are cases when you want tests to be part of a module but not part
of the help text, which requires that the tests not be included in the docstring.
Doctest looks for a module-level variable called ``__test__`` and uses it to locate other
tests. If ``M.__test__`` exists and is truthy, it must be a dict, and each
tests. If ``M.__test__`` exists, it must be a dict, and each
entry maps a (string) name to a function object, class object, or string.
Function and class object docstrings found from ``M.__test__`` are searched, and
strings are treated as if they were docstrings. In output, a key ``K`` in
Expand Down Expand Up @@ -944,8 +944,8 @@ and :ref:`doctest-simple-testfile`.
(or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with
``m.__doc__``.

Also test examples reachable from dict ``m.__test__``, if it exists and is not
``None``. ``m.__test__`` maps names (strings) to functions, classes and
Also test examples reachable from dict ``m.__test__``, if it exists.
``m.__test__`` maps names (strings) to functions, classes and
strings; function and class docstrings are searched for examples; strings are
searched directly, as if they were docstrings.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/gc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The :mod:`gc` module provides the following functions:
.. versionadded:: 3.4


.. function:: set_threshold(threshold0[, threshold1[, threshold2]])
.. function:: set_threshold(threshold0, [threshold1, [threshold2]])

Set the garbage collection thresholds (the collection frequency). Setting
*threshold0* to zero disables collection.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/heapq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ winner. The simplest algorithmic way to remove it and find the "next" winner is
to move some loser (let's say cell 30 in the diagram above) into the 0 position,
and then percolate this new 0 down the tree, exchanging values, until the
invariant is re-established. This is clearly logarithmic on the total number of
items in the tree. By iterating over all items, you get an O(n log n) sort.
items in the tree. By iterating over all items, you get an *O*\ (*n* log *n*) sort.

A nice feature of this sort is that you can efficiently insert new items while
the sort is going on, provided that the inserted items are not "better" than the
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ The following recipes have a more mathematical flavor:
# https://mathworld.wolfram.com/TotientFunction.html
# totient(12) --> 4 because len([1, 5, 7, 11]) == 4
for p in unique_justseen(factor(n)):
n = n // p * (p - 1)
n -= n // p
return n


Expand Down
8 changes: 6 additions & 2 deletions Doc/library/msvcrt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ File Operations
.. function:: open_osfhandle(handle, flags)

Create a C runtime file descriptor from the file handle *handle*. The *flags*
parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os.O_RDONLY`,
and :const:`os.O_TEXT`. The returned file descriptor may be used as a parameter
parameter should be a bitwise OR of :const:`os.O_APPEND`,
:const:`os.O_RDONLY`, :const:`os.O_TEXT` and :const:`os.O_NOINHERIT`.
The returned file descriptor may be used as a parameter
to :func:`os.fdopen` to create a file object.

The file descriptor is inheritable by default. Pass :const:`os.O_NOINHERIT`
flag to make it non inheritable.

.. audit-event:: msvcrt.open_osfhandle handle,flags msvcrt.open_osfhandle


Expand Down
8 changes: 8 additions & 0 deletions Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,

See :ref:`pickle-persistent` for details and examples of uses.

.. versionchanged:: 3.13
Add the default implementation of this method in the C implementation
of :class:`!Pickler`.

.. attribute:: dispatch_table

A pickler object's dispatch table is a registry of *reduction
Expand Down Expand Up @@ -446,6 +450,10 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,

See :ref:`pickle-persistent` for details and examples of uses.

.. versionchanged:: 3.13
Add the default implementation of this method in the C implementation
of :class:`!Unpickler`.

.. method:: find_class(module, name)

Import *module* if necessary and return the object called *name* from it,
Expand Down
8 changes: 5 additions & 3 deletions Doc/library/plistlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ top level object is a dictionary.
To write out and to parse a plist file, use the :func:`dump` and
:func:`load` functions.

To work with plist data in bytes objects, use :func:`dumps`
To work with plist data in bytes or string objects, use :func:`dumps`
and :func:`loads`.

Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
Expand Down Expand Up @@ -89,11 +89,13 @@ This module defines the following functions:

.. function:: loads(data, *, fmt=None, dict_type=dict, aware_datetime=False)

Load a plist from a bytes object. See :func:`load` for an explanation of
the keyword arguments.
Load a plist from a bytes or string object. See :func:`load` for an
explanation of the keyword arguments.

.. versionadded:: 3.4

.. versionchanged:: 3.13
*data* can be a string when *fmt* equals :data:`FMT_XML`.

.. function:: dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False, aware_datetime=False)

Expand Down
Loading

0 comments on commit 2e128e2

Please sign in to comment.