Skip to content

Commit 5c0a21c

Browse files
committed
Merge branch 'main' into superopt
* main: (24 commits) pythongh-98040: Move the Single-Phase Init Tests Out of test_imp (pythongh-102561) pythongh-83861: Fix datetime.astimezone() method (pythonGH-101545) pythongh-102856: Clean some of the PEP 701 tokenizer implementation (python#103634) pythongh-102856: Skip test_mismatched_parens in WASI builds (python#103633) pythongh-102856: Initial implementation of PEP 701 (python#102855) pythongh-103583: Add ref. dependency between multibytecodec modules (python#103589) pythongh-83004: Harden msvcrt further (python#103420) pythonGH-88342: clarify that `asyncio.as_completed` accepts generators yielding tasks (python#103626) pythongh-102778: IDLE - make sys.last_exc available in Shell after traceback (python#103314) pythongh-103582: Remove last references to `argparse.REMAINDER` from docs (python#103586) pythongh-103583: Always pass multibyte codec structs as const (python#103588) pythongh-103617: Fix compiler warning in _iomodule.c (python#103618) pythongh-103596: [Enum] do not shadow mixed-in methods/attributes (pythonGH-103600) pythonGH-100530: Change the error message for non-class class patterns (pythonGH-103576) pythongh-95299: Remove lingering setuptools reference in installer scripts (pythonGH-103613) [Doc] Fix a typo in optparse.rst (python#103504) pythongh-101100: Fix broken reference `__format__` in `string.rst` (python#103531) pythongh-95299: Stop installing setuptools as a part of ensurepip and venv (python#101039) pythonGH-103484: Docs: add linkcheck allowed redirects entries for most cases (python#103569) pythongh-67230: update whatsnew note for csv changes (python#103598) ...
2 parents e4466a7 + 6be7aee commit 5c0a21c

File tree

81 files changed

+7953
-5337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+7953
-5337
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Lib/test/xmltestdata/* noeol
3434

3535
# Shell scripts should have LF even on Windows because of Cygwin
3636
Lib/venv/scripts/common/activate text eol=lf
37+
Lib/venv/scripts/posix/* text eol=lf
3738

3839
# CRLF files
3940
[attr]dos text eol=crlf

.github/workflows/verify-ensurepip-wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify bundled pip and setuptools
1+
name: Verify bundled wheels
22

33
on:
44
workflow_dispatch:
@@ -29,5 +29,5 @@ jobs:
2929
- uses: actions/setup-python@v4
3030
with:
3131
python-version: '3'
32-
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
32+
- name: Compare checksum of bundled wheels to the ones published on PyPI
3333
run: ./Tools/build/verify_ensurepip_wheels.py

Doc/conf.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,14 @@
254254
# Options for the link checker
255255
# ----------------------------
256256

257-
# Ignore certain URLs.
258-
linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+']
259-
257+
linkcheck_allowed_redirects = {
258+
# bpo-NNNN -> BPO -> GH Issues
259+
r'https://bugs.python.org/issue\?@action=redirect&bpo=\d+': 'https://github.com/python/cpython/issues/\d+',
260+
# GH-NNNN used to refer to pull requests
261+
r'https://github.com/python/cpython/issues/\d+': 'https://github.com/python/cpython/pull/\d+',
262+
# :source:`something` linking files in the repository
263+
r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*'
264+
}
260265

261266
# Options for extensions
262267
# ----------------------

Doc/howto/enum.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ inherits from :class:`Enum` itself.
3636

3737
.. note:: Case of Enum Members
3838

39-
Because Enums are used to represent constants we recommend using
40-
UPPER_CASE names for members, and will be using that style in our examples.
39+
Because Enums are used to represent constants, and to help avoid issues
40+
with name clashes between mixin-class methods/attributes and enum names,
41+
we strongly recommend using UPPER_CASE names for members, and will be using
42+
that style in our examples.
4143

4244
Depending on the nature of the enum a member's value may or may not be
4345
important, but either way that value can be used to get the corresponding
@@ -490,6 +492,10 @@ the :meth:`~Enum.__repr__` omits the inherited class' name. For example::
490492
Use the :func:`!dataclass` argument ``repr=False``
491493
to use the standard :func:`repr`.
492494

495+
.. versionchanged:: 3.12
496+
Only the dataclass fields are shown in the value area, not the dataclass'
497+
name.
498+
493499

494500
Pickling
495501
--------
@@ -992,7 +998,9 @@ but remain normal attributes.
992998
Enum members are instances of their enum class, and are normally accessed as
993999
``EnumClass.member``. In certain situations, such as writing custom enum
9941000
behavior, being able to access one member directly from another is useful,
995-
and is supported.
1001+
and is supported; however, in order to avoid name clashes between member names
1002+
and attributes/methods from mixed-in classes, upper-case names are strongly
1003+
recommended.
9961004

9971005
.. versionchanged:: 3.5
9981006

Doc/library/argparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ default_ Default value used when an argument is not provided
6767
dest_ Specify the attribute name used in the result namespace
6868
help_ Help message for an argument
6969
metavar_ Alternate display name for the argument as shown in help
70-
nargs_ Number of times the argument can be used :class:`int`, ``'?'``, ``'*'``, ``'+'``, or ``argparse.REMAINDER``
70+
nargs_ Number of times the argument can be used :class:`int`, ``'?'``, ``'*'``, or ``'+'``
7171
required_ Indicate whether an argument is required or optional ``True`` or ``False``
7272
type_ Automatically convert an argument to the given type :class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable function
7373
====================== =========================================================== ==========================================================================================================================
@@ -2218,7 +2218,7 @@ support this parsing style.
22182218

22192219
These parsers do not support all the argparse features, and will raise
22202220
exceptions if unsupported features are used. In particular, subparsers,
2221-
``argparse.REMAINDER``, and mutually exclusive groups that include both
2221+
and mutually exclusive groups that include both
22222222
optionals and positionals are not supported.
22232223

22242224
The following example shows the difference between

Doc/library/asyncio-task.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ Waiting Primitives
829829
Deprecation warning is emitted if not all awaitable objects in the *aws*
830830
iterable are Future-like objects and there is no running event loop.
831831

832+
.. versionchanged:: 3.12
833+
Added support for generators yielding tasks.
834+
832835

833836
Running in Threads
834837
==================

Doc/library/enum.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ Module Contents
119119
:func:`~enum.property`
120120

121121
Allows :class:`Enum` members to have attributes without conflicting with
122-
member names.
122+
member names. The ``value`` and ``name`` attributes are implemented this
123+
way.
123124

124125
:func:`unique`
125126

@@ -169,7 +170,7 @@ Data Types
169170
final *enum*, as well as creating the enum members, properly handling
170171
duplicates, providing iteration over the enum class, etc.
171172

172-
.. method:: EnumType.__call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
173+
.. method:: EnumType.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None)
173174

174175
This method is called in two different ways:
175176

@@ -317,7 +318,7 @@ Data Types
317318
>>> PowersOfThree.SECOND.value
318319
9
319320

320-
.. method:: Enum.__init_subclass__(cls, **kwds)
321+
.. method:: Enum.__init_subclass__(cls, \**kwds)
321322

322323
A *classmethod* that is used to further configure subsequent subclasses.
323324
By default, does nothing.

Doc/library/optparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ Features of note:
20272027
values.ensure_value(attr, value)
20282028

20292029
If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then
2030-
ensure_value() first sets it to ``value``, and then returns 'value. This is
2030+
ensure_value() first sets it to ``value``, and then returns ``value``. This is
20312031
very handy for actions like ``"extend"``, ``"append"``, and ``"count"``, all
20322032
of which accumulate data in a variable and expect that variable to be of a
20332033
certain type (a list for the first two, an integer for the latter). Using

Doc/library/string.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ Some simple format string examples::
254254
"Units destroyed: {players[0]}" # First element of keyword argument 'players'.
255255

256256
The *conversion* field causes a type coercion before formatting. Normally, the
257-
job of formatting a value is done by the :meth:`__format__` method of the value
257+
job of formatting a value is done by the :meth:`~object.__format__` method of the value
258258
itself. However, in some cases it is desirable to force a type to be formatted
259259
as a string, overriding its own definition of formatting. By converting the
260-
value to a string before calling :meth:`__format__`, the normal formatting logic
260+
value to a string before calling :meth:`~object.__format__`, the normal formatting logic
261261
is bypassed.
262262

263263
Three conversion flags are currently supported: ``'!s'`` which calls :func:`str`

Doc/library/token-list.inc

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)