Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into instr_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Sep 11, 2023
2 parents cb22365 + de5f8f7 commit 9875704
Show file tree
Hide file tree
Showing 138 changed files with 4,860 additions and 3,814 deletions.
7 changes: 5 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ freebsd_task:
sysctl_script:
- sysctl net.inet.tcp.blackhole=0
- sysctl net.inet.udp.blackhole=0
build_script:
configure_script:
- mkdir build
- cd build
- ../configure --with-pydebug
build_script:
- cd build
- make -j$(sysctl -n hw.ncpu)
pythoninfo_script:
- cd build && make pythoninfo
- cd build
- make pythoninfo
test_script:
- cd build
# dtrace fails to build on FreeBSD - see gh-73263
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,6 @@ Doc/c-api/stable.rst @encukou
/Tools/clinic/** @erlend-aasland @AlexWaygood
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
Doc/howto/clinic.rst @erlend-aasland

# WebAssembly
/Tools/wasm/ @brettcannon
46 changes: 42 additions & 4 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ Expressions

.. class:: NamedExpr(target, value)

A named expression. This AST node is produced by the assignment expressions
operator (also known as the walrus operator). As opposed to the :class:`Assign`
node in which the first argument can be multiple nodes, in this case both
``target`` and ``value`` must be single nodes.
A named expression. This AST node is produced by the assignment expressions
operator (also known as the walrus operator). As opposed to the :class:`Assign`
node in which the first argument can be multiple nodes, in this case both
``target`` and ``value`` must be single nodes.

.. doctest::

Expand All @@ -663,6 +663,7 @@ Expressions
target=Name(id='x', ctx=Store()),
value=Constant(value=4)))

.. versionadded:: 3.8

Subscripting
~~~~~~~~~~~~
Expand Down Expand Up @@ -1036,6 +1037,7 @@ Statements
value=Name(id='int', ctx=Load()))],
type_ignores=[])

.. versionadded:: 3.12

Other statements which are only applicable inside functions or loops are
described in other sections.
Expand Down Expand Up @@ -1318,6 +1320,7 @@ Control flow
finalbody=[])],
type_ignores=[])

.. versionadded:: 3.11

.. class:: ExceptHandler(type, name, body)

Expand Down Expand Up @@ -1407,6 +1410,8 @@ Pattern matching
that is being matched against the cases) and ``cases`` contains an iterable of
:class:`match_case` nodes with the different cases.

.. versionadded:: 3.10

.. class:: match_case(pattern, guard, body)

A single case pattern in a ``match`` statement. ``pattern`` contains the
Expand Down Expand Up @@ -1458,6 +1463,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchValue(value)

A match literal or value pattern that compares by equality. ``value`` is
Expand Down Expand Up @@ -1485,6 +1492,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchSingleton(value)

A match literal pattern that compares by identity. ``value`` is the
Expand All @@ -1510,6 +1519,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchSequence(patterns)

A match sequence pattern. ``patterns`` contains the patterns to be matched
Expand Down Expand Up @@ -1541,6 +1552,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchStar(name)

Matches the rest of the sequence in a variable length match sequence pattern.
Expand Down Expand Up @@ -1581,6 +1594,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchMapping(keys, patterns, rest)

A match mapping pattern. ``keys`` is a sequence of expression nodes.
Expand Down Expand Up @@ -1627,6 +1642,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchClass(cls, patterns, kwd_attrs, kwd_patterns)

A match class pattern. ``cls`` is an expression giving the nominal class to
Expand Down Expand Up @@ -1691,6 +1708,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchAs(pattern, name)

A match "as-pattern", capture pattern or wildcard pattern. ``pattern``
Expand Down Expand Up @@ -1732,6 +1751,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. class:: MatchOr(patterns)

A match "or-pattern". An or-pattern matches each of its subpatterns in turn
Expand Down Expand Up @@ -1764,6 +1785,8 @@ Pattern matching
value=Constant(value=Ellipsis))])])],
type_ignores=[])

.. versionadded:: 3.10

.. _ast-type-params:

Type parameters
Expand Down Expand Up @@ -1795,6 +1818,8 @@ aliases.
ctx=Load()))],
type_ignores=[])

.. versionadded:: 3.12

.. class:: ParamSpec(name)

A :class:`typing.ParamSpec`. ``name`` is the name of the parameter specification.
Expand All @@ -1818,6 +1843,8 @@ aliases.
ctx=Load()))],
type_ignores=[])

.. versionadded:: 3.12

.. class:: TypeVarTuple(name)

A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable tuple.
Expand All @@ -1842,6 +1869,8 @@ aliases.
ctx=Load()))],
type_ignores=[])

.. versionadded:: 3.12

Function and class definitions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -1861,6 +1890,9 @@ Function and class definitions

``type_comment`` is an optional string with the type annotation as a comment.

.. versionchanged:: 3.12
Added ``type_params``.


.. class:: Lambda(args, body)

Expand Down Expand Up @@ -2059,6 +2091,9 @@ Function and class definitions
type_params=[])],
type_ignores=[])

.. versionchanged:: 3.12
Added ``type_params``.

Async and await
^^^^^^^^^^^^^^^

Expand All @@ -2067,6 +2102,9 @@ Async and await
An ``async def`` function definition. Has the same fields as
:class:`FunctionDef`.

.. versionchanged:: 3.12
Added ``type_params``.


.. class:: Await(value)

Expand Down
11 changes: 7 additions & 4 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1030,13 +1030,16 @@ The following recipes have a more mathematical flavor:
def sieve(n):
"Primes less than n."
# sieve(30) --> 2 3 5 7 11 13 17 19 23 29
if n > 2:
yield 2
start = 3
data = bytearray((0, 1)) * (n // 2)
data[:3] = 0, 0, 0
limit = math.isqrt(n) + 1
for p in compress(range(limit), data):
for p in iter_index(data, 1, start, limit):
yield from iter_index(data, 1, start, p*p)
data[p*p : n : p+p] = bytes(len(range(p*p, n, p+p)))
data[2] = 1
return iter_index(data, 1) if n > 2 else iter([])
start = p*p
yield from iter_index(data, 1, start)

def factor(n):
"Prime factors of n."
Expand Down
39 changes: 20 additions & 19 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1618,25 +1618,6 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
Parameters *out* and *in* was renamed to *out_fd* and *in_fd*.


.. function:: set_blocking(fd, blocking, /)

Set the blocking mode of the specified file descriptor. Set the
:data:`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise.

See also :func:`get_blocking` and :meth:`socket.socket.setblocking`.

.. availability:: Unix, Windows.

The function is limited on Emscripten and WASI, see
:ref:`wasm-availability` for more information.

On Windows, this function is limited to pipes.

.. versionadded:: 3.5

.. versionchanged:: 3.12
Added support for pipes on Windows.

.. data:: SF_NODISKIO
SF_MNOWAIT
SF_SYNC
Expand All @@ -1658,6 +1639,26 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
.. versionadded:: 3.11


.. function:: set_blocking(fd, blocking, /)

Set the blocking mode of the specified file descriptor. Set the
:data:`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise.

See also :func:`get_blocking` and :meth:`socket.socket.setblocking`.

.. availability:: Unix, Windows.

The function is limited on Emscripten and WASI, see
:ref:`wasm-availability` for more information.

On Windows, this function is limited to pipes.

.. versionadded:: 3.5

.. versionchanged:: 3.12
Added support for pipes on Windows.


.. function:: splice(src, dst, count, offset_src=None, offset_dst=None)

Transfer *count* bytes from file descriptor *src*, starting from offset
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ Additional Utility Classes and Functions
However, for a structured record type use :func:`~collections.namedtuple`
instead.

:class:`!SimpleNamespace` objects are supported by :func:`copy.replace`.

.. versionadded:: 3.3

.. versionchanged:: 3.9
Expand Down
Loading

0 comments on commit 9875704

Please sign in to comment.