Skip to content

Commit 116f72e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pep688v2
2 parents de3a4bc + 49f6106 commit 116f72e

File tree

202 files changed

+5325
-2191
lines changed

Some content is hidden

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

202 files changed

+5325
-2191
lines changed

.azure-pipelines/posix-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ steps:
6868
- ${{ if eq(parameters.patchcheck, 'true') }}:
6969
- script: |
7070
git fetch origin
71-
./python Tools/scripts/patchcheck.py --ci true
71+
./python Tools/patchcheck/patchcheck.py --ci true
7272
displayName: 'Run patchcheck.py'
7373
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
7474

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Python/traceback.c @iritkatriel
5555
/Lib/html/ @ezio-melotti
5656
/Lib/_markupbase.py @ezio-melotti
5757
/Lib/test/test_html*.py @ezio-melotti
58-
/Tools/scripts/*html5* @ezio-melotti
58+
/Tools/build/parse_html5_entities.py @ezio-melotti
5959

6060
# Import (including importlib).
6161
# Ignoring importlib.h so as to not get flagged on
@@ -135,7 +135,7 @@ Lib/ast.py @isidentical
135135

136136
**/*idlelib* @terryjreedy
137137

138-
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra
138+
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood
139139

140140
**/*asyncore @giampaolo
141141
**/*asynchat @giampaolo

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
paths:
77
- 'Lib/ensurepip/_bundled/**'
88
- '.github/workflows/verify-ensurepip-wheels.yml'
9-
- 'Tools/scripts/verify_ensurepip_wheels.py'
9+
- 'Tools/build/verify_ensurepip_wheels.py'
1010
pull_request:
1111
paths:
1212
- 'Lib/ensurepip/_bundled/**'
1313
- '.github/workflows/verify-ensurepip-wheels.yml'
14-
- 'Tools/scripts/verify_ensurepip_wheels.py'
14+
- 'Tools/build/verify_ensurepip_wheels.py'
1515

1616
permissions:
1717
contents: read
@@ -29,4 +29,4 @@ jobs:
2929
with:
3030
python-version: '3'
3131
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
32-
run: ./Tools/scripts/verify_ensurepip_wheels.py
32+
run: ./Tools/build/verify_ensurepip_wheels.py

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Tools/ssl/win32
143143
Tools/freeze/test/outdir
144144

145145
# The frozen modules are always generated by the build so we don't
146-
# keep them in the repo. Also see Tools/scripts/freeze_modules.py.
146+
# keep them in the repo. Also see Tools/build/freeze_modules.py.
147147
Python/frozen_modules/*.h
148148
# The manifest can be generated at any time with "make regen-frozen".
149149
Python/frozen_modules/MANIFEST

Doc/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2121
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j auto \
2222
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
2323

24-
.PHONY: help build html htmlhelp latex text texinfo changes linkcheck \
25-
coverage doctest pydoc-topics htmlview clean dist check serve \
26-
autobuild-dev autobuild-stable venv
24+
.PHONY: help build html htmlhelp latex text texinfo epub changes linkcheck \
25+
coverage doctest pydoc-topics htmlview clean clean-venv venv dist check serve \
26+
autobuild-dev autobuild-dev-html autobuild-stable autobuild-stable-html
2727

2828
help:
2929
@echo "Please use \`make <target>' where <target> is one of"

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ is not possible due to its implementation being opaque at build time.
19331933
19341934
.. note::
19351935
A freed key becomes a dangling pointer. You should reset the key to
1936-
`NULL`.
1936+
``NULL``.
19371937
19381938
19391939
Methods

Doc/c-api/refcounting.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ The macros in this section are used for managing reference counts of Python
1111
objects.
1212

1313

14+
.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
15+
16+
Get the reference count of the Python object *o*.
17+
18+
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
19+
20+
.. versionchanged:: 3.11
21+
The parameter type is no longer :c:expr:`const PyObject*`.
22+
23+
.. versionchanged:: 3.10
24+
:c:func:`Py_REFCNT()` is changed to the inline static function.
25+
26+
27+
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
28+
29+
Set the object *o* reference counter to *refcnt*.
30+
31+
.. versionadded:: 3.9
32+
33+
1434
.. c:function:: void Py_INCREF(PyObject *o)
1535
1636
Increment the reference count for object *o*.

Doc/c-api/structures.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ All Python objects ultimately share a small number of fields at the beginning
1717
of the object's representation in memory. These are represented by the
1818
:c:type:`PyObject` and :c:type:`PyVarObject` types, which are defined, in turn,
1919
by the expansions of some macros also used, whether directly or indirectly, in
20-
the definition of all other Python objects.
20+
the definition of all other Python objects. Additional macros can be found
21+
under :ref:`reference counting <countingrefs>`.
2122

2223

2324
.. c:type:: PyObject
@@ -121,26 +122,6 @@ the definition of all other Python objects.
121122
.. versionadded:: 3.9
122123
123124
124-
.. c:function:: Py_ssize_t Py_REFCNT(PyObject *o)
125-
126-
Get the reference count of the Python object *o*.
127-
128-
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
129-
130-
.. versionchanged:: 3.11
131-
The parameter type is no longer :c:expr:`const PyObject*`.
132-
133-
.. versionchanged:: 3.10
134-
:c:func:`Py_REFCNT()` is changed to the inline static function.
135-
136-
137-
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
138-
139-
Set the object *o* reference counter to *refcnt*.
140-
141-
.. versionadded:: 3.9
142-
143-
144125
.. c:function:: Py_ssize_t Py_SIZE(PyVarObject *o)
145126
146127
Get the size of the Python object *o*.

Doc/faq/general.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ find packages of interest to you.
125125
How does the Python version numbering scheme work?
126126
--------------------------------------------------
127127

128-
Python versions are numbered A.B.C or A.B. A is the major version number -- it
129-
is only incremented for really major changes in the language. B is the minor
130-
version number, incremented for less earth-shattering changes. C is the
131-
micro-level -- it is incremented for each bugfix release. See :pep:`6` for more
132-
information about bugfix releases.
128+
Python versions are numbered "A.B.C" or "A.B":
129+
130+
* *A* is the major version number -- it is only incremented for really major
131+
changes in the language.
132+
* *B* is the minor version number -- it is incremented for less earth-shattering
133+
changes.
134+
* *C* is the micro version number -- it is incremented for each bugfix release.
135+
136+
See :pep:`6` for more information about bugfix releases.
133137

134138
Not all releases are bugfix releases. In the run-up to a new major release, a
135139
series of development releases are made, denoted as alpha, beta, or release
@@ -139,12 +143,14 @@ Betas are more stable, preserving existing interfaces but possibly adding new
139143
modules, and release candidates are frozen, making no changes except as needed
140144
to fix critical bugs.
141145

142-
Alpha, beta and release candidate versions have an additional suffix. The
143-
suffix for an alpha version is "aN" for some small number N, the suffix for a
144-
beta version is "bN" for some small number N, and the suffix for a release
145-
candidate version is "rcN" for some small number N. In other words, all versions
146-
labeled 2.0aN precede the versions labeled 2.0bN, which precede versions labeled
147-
2.0rcN, and *those* precede 2.0.
146+
Alpha, beta and release candidate versions have an additional suffix:
147+
148+
* The suffix for an alpha version is "aN" for some small number *N*.
149+
* The suffix for a beta version is "bN" for some small number *N*.
150+
* The suffix for a release candidate version is "rcN" for some small number *N*.
151+
152+
In other words, all versions labeled *2.0aN* precede the versions labeled
153+
*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0.
148154

149155
You may also find version numbers with a "+" suffix, e.g. "2.2+". These are
150156
unreleased versions, built directly from the CPython development repository. In
@@ -429,7 +435,7 @@ With the interpreter, documentation is never far from the student as they are
429435
programming.
430436

431437
There are also good IDEs for Python. IDLE is a cross-platform IDE for Python
432-
that is written in Python using Tkinter. PythonWin is a Windows-specific IDE.
438+
that is written in Python using Tkinter.
433439
Emacs users will be happy to know that there is a very good Python mode for
434440
Emacs. All of these programming environments provide syntax highlighting,
435441
auto-indenting, and access to the interactive interpreter while coding. Consult

Doc/glossary.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,16 @@ Glossary
210210
A list of bytecode instructions can be found in the documentation for
211211
:ref:`the dis module <bytecodes>`.
212212

213+
callable
214+
A callable is an object that can be called, possibly with a set
215+
of arguments (see :term:`argument`), with the following syntax::
216+
217+
callable(argument1, argument2, ...)
218+
219+
A :term:`function`, and by extension a :term:`method`, is a callable.
220+
An instance of a class that implements the :meth:`~object.__call__`
221+
method is also a callable.
222+
213223
callback
214224
A subroutine function which is passed as an argument to be executed at
215225
some point in the future.

0 commit comments

Comments
 (0)