Skip to content

Commit

Permalink
Merge branch 'main' into issue-83417-venv-gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored Sep 10, 2023
2 parents c3b96e0 + 0c0f254 commit a8528dd
Show file tree
Hide file tree
Showing 207 changed files with 4,993 additions and 3,317 deletions.
26 changes: 26 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
freebsd_task:
freebsd_instance:
matrix:
- image: freebsd-13-2-release-amd64
# Turn off TCP and UDP blackhole. It is not enabled by default in FreeBSD,
# but it is in the FreeBSD GCE images as used by Cirrus-CI. It causes even
# local local connections to fail with ETIMEDOUT instead of ECONNREFUSED.
# For more information see https://reviews.freebsd.org/D41751 and
# https://github.com/cirruslabs/cirrus-ci-docs/issues/483.
sysctl_script:
- sysctl net.inet.tcp.blackhole=0
- sysctl net.inet.udp.blackhole=0
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
test_script:
- cd build
# dtrace fails to build on FreeBSD - see gh-73263
- make buildbottest TESTOPTS="-j0 -x test_dtrace --timeout=600"
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
143 changes: 143 additions & 0 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,146 @@ The :mod:`calendar` module defines the following exceptions:

Module :mod:`time`
Low-level time related functions.


.. _calendar-cli:

Command-Line Usage
------------------

.. versionadded:: 2.5

The :mod:`calendar` module can be executed as a script from the command line
to interactively print a calendar.

.. code-block:: shell
python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]
[-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]
[year] [month]
For example, to print a calendar for the year 2000:

.. code-block:: console
$ python -m calendar 2000
2000
January February March
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 1 2 3 4 5 6 1 2 3 4 5
3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12
10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19
17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26
24 25 26 27 28 29 30 28 29 27 28 29 30 31
31
April May June
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 1 2 3 4 5 6 7 1 2 3 4
3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11
10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18
17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25
24 25 26 27 28 29 30 29 30 31 26 27 28 29 30
July August September
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 1 2 3 4 5 6 1 2 3
3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10
10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17
17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24
24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30
31
October November December
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 1 2 3 4 5 1 2 3
2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10
9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17
16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24
23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31
30 31
The following options are accepted:

.. program:: calendar


.. option:: --help, -h

Show the help message and exit.


.. option:: --locale LOCALE, -L LOCALE

The locale to use for month and weekday names.
Defaults to English.


.. option:: --encoding ENCODING, -e ENCODING

The encoding to use for output.
:option:`--encoding` is required if :option:`--locale` is set.


.. option:: --type {text,html}, -t {text,html}

Print the calendar to the terminal as text,
or as an HTML document.


.. option:: year

The year to print the calendar for.
Must be a number between 1 and 9999.
Defaults to the current year.


.. option:: month

The month of the specified :option:`year` to print the calendar for.
Must be a number between 1 and 12,
and may only be used in text mode.
Defaults to printing a calendar for the full year.


*Text-mode options:*

.. option:: --width WIDTH, -w WIDTH

The width of the date column in terminal columns.
The date is printed centred in the column.
Any value lower than 2 is ignored.
Defaults to 2.


.. option:: --lines LINES, -l LINES

The number of lines for each week in terminal rows.
The date is printed top-aligned.
Any value lower than 1 is ignored.
Defaults to 1.


.. option:: --spacing SPACING, -s SPACING

The space between months in columns.
Any value lower than 2 is ignored.
Defaults to 6.


.. option:: --months MONTHS, -m MONTHS

The number of months printed per row.
Defaults to 3.


*HTML-mode options:*

.. option:: --css CSS, -c CSS

The path of a CSS stylesheet to use for the calendar.
This must either be relative to the generated HTML,
or an absolute HTTP or ``file:///`` URL.
2 changes: 2 additions & 0 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ field names, the method and attribute names start with an underscore.
>>> for partnum, record in inventory.items():
... inventory[partnum] = record._replace(price=newprices[partnum], timestamp=time.now())

Named tuples are also supported by generic function :func:`copy.replace`.

.. attribute:: somenamedtuple._fields

Tuple of strings listing the field names. Useful for introspection
Expand Down
6 changes: 4 additions & 2 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,10 @@ ConfigParser Objects

When *default_section* is given, it specifies the name for the special
section holding default values for other sections and interpolation purposes
(normally named ``"DEFAULT"``). This value can be retrieved and changed on
runtime using the ``default_section`` instance attribute.
(normally named ``"DEFAULT"``). This value can be retrieved and changed at
runtime using the ``default_section`` instance attribute. This won't
re-evaluate an already parsed config file, but will be used when writing
parsed settings to a new config file.

Interpolation behaviour may be customized by providing a custom handler
through the *interpolation* argument. ``None`` can be used to turn off
Expand Down
Loading

0 comments on commit a8528dd

Please sign in to comment.