Skip to content

Commit f61fe41

Browse files
authored
Merge branch 'main' into c-cleandoc
2 parents 34d0cbd + 388b5da commit f61fe41

File tree

164 files changed

+5011
-1508
lines changed

Some content is hidden

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

164 files changed

+5011
-1508
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,7 @@ Doc/c-api/stable.rst @encukou
173173

174174
# zipfile.Path
175175
**/*zipfile/*_path.py @jaraco
176+
177+
# Argument Clinic
178+
/Tools/clinic/** @erlend-aasland @AlexWaygood
179+
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,3 +519,60 @@ jobs:
519519
run: make pythoninfo
520520
- name: Tests
521521
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
522+
523+
all-required-green: # This job does nothing and is only used for the branch protection
524+
name: All required checks pass
525+
if: always()
526+
527+
needs:
528+
- check_source # Transitive dependency, needed to access `run_tests` value
529+
- check-docs
530+
- check_generated_files
531+
- build_win32
532+
- build_win_amd64
533+
- build_macos
534+
- build_ubuntu
535+
- build_ubuntu_ssltests
536+
- test_hypothesis
537+
- build_asan
538+
539+
runs-on: ubuntu-latest
540+
541+
steps:
542+
- name: Check whether the needed jobs succeeded or failed
543+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
544+
with:
545+
allowed-failures: >-
546+
build_macos,
547+
build_ubuntu_ssltests,
548+
build_win32,
549+
test_hypothesis,
550+
allowed-skips: >-
551+
${{
552+
!fromJSON(needs.check_source.outputs.run-docs)
553+
&& '
554+
check-docs,
555+
'
556+
|| ''
557+
}}
558+
${{
559+
needs.check_source.outputs.run_tests != 'true'
560+
&& '
561+
check_generated_files,
562+
build_win32,
563+
build_win_amd64,
564+
build_macos,
565+
build_ubuntu,
566+
build_ubuntu_ssltests,
567+
build_asan,
568+
'
569+
|| ''
570+
}}
571+
${{
572+
!fromJSON(needs.check_source.outputs.run_hypothesis)
573+
&& '
574+
test_hypothesis,
575+
'
576+
|| ''
577+
}}
578+
jobs: ${{ toJSON(needs) }}

.github/workflows/new-bugs-announce-notifier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
// We need to truncate the body size, because the max size for
4545
// the whole payload is 16kb. We want to be safe and assume that
4646
// body can take up to ~8kb of space.
47-
body : issue.data.body.substring(8000)
47+
body : issue.data.body.substring(0, 8000)
4848
};
4949
5050
const data = {

Doc/c-api/init.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
8787

8888
Set by the :option:`-b` option.
8989

90-
.. deprecated:: 3.12
90+
.. deprecated-removed:: 3.12 3.14
9191

9292
.. c:var:: int Py_DebugFlag
9393
@@ -101,7 +101,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
101101
Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment
102102
variable.
103103

104-
.. deprecated:: 3.12
104+
.. deprecated-removed:: 3.12 3.14
105105

106106
.. c:var:: int Py_DontWriteBytecodeFlag
107107
@@ -115,7 +115,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
115115
Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE`
116116
environment variable.
117117

118-
.. deprecated:: 3.12
118+
.. deprecated-removed:: 3.12 3.14
119119

120120
.. c:var:: int Py_FrozenFlag
121121
@@ -128,7 +128,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
128128

129129
Private flag used by ``_freeze_module`` and ``frozenmain`` programs.
130130

131-
.. deprecated:: 3.12
131+
.. deprecated-removed:: 3.12 3.14
132132

133133
.. c:var:: int Py_HashRandomizationFlag
134134
@@ -143,7 +143,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
143143
If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment
144144
variable to initialize the secret hash seed.
145145

146-
.. deprecated:: 3.12
146+
.. deprecated-removed:: 3.12 3.14
147147

148148
.. c:var:: int Py_IgnoreEnvironmentFlag
149149
@@ -156,7 +156,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
156156

157157
Set by the :option:`-E` and :option:`-I` options.
158158

159-
.. deprecated:: 3.12
159+
.. deprecated-removed:: 3.12 3.14
160160

161161
.. c:var:: int Py_InspectFlag
162162
@@ -171,7 +171,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
171171
Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment
172172
variable.
173173

174-
.. deprecated:: 3.12
174+
.. deprecated-removed:: 3.12 3.14
175175

176176
.. c:var:: int Py_InteractiveFlag
177177
@@ -196,7 +196,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
196196

197197
.. versionadded:: 3.4
198198

199-
.. deprecated:: 3.12
199+
.. deprecated-removed:: 3.12 3.14
200200

201201
.. c:var:: int Py_LegacyWindowsFSEncodingFlag
202202
@@ -215,7 +215,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
215215

216216
.. availability:: Windows.
217217

218-
.. deprecated:: 3.12
218+
.. deprecated-removed:: 3.12 3.14
219219

220220
.. c:var:: int Py_LegacyWindowsStdioFlag
221221
@@ -233,7 +233,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
233233

234234
.. availability:: Windows.
235235

236-
.. deprecated:: 3.12
236+
.. deprecated-removed:: 3.12 3.14
237237

238238
.. c:var:: int Py_NoSiteFlag
239239
@@ -248,7 +248,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
248248

249249
Set by the :option:`-S` option.
250250

251-
.. deprecated:: 3.12
251+
.. deprecated-removed:: 3.12 3.14
252252

253253
.. c:var:: int Py_NoUserSiteDirectory
254254
@@ -262,7 +262,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
262262
Set by the :option:`-s` and :option:`-I` options, and the
263263
:envvar:`PYTHONNOUSERSITE` environment variable.
264264

265-
.. deprecated:: 3.12
265+
.. deprecated-removed:: 3.12 3.14
266266

267267
.. c:var:: int Py_OptimizeFlag
268268
@@ -273,7 +273,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
273273
Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment
274274
variable.
275275

276-
.. deprecated:: 3.12
276+
.. deprecated-removed:: 3.12 3.14
277277

278278
.. c:var:: int Py_QuietFlag
279279
@@ -287,7 +287,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
287287

288288
.. versionadded:: 3.2
289289

290-
.. deprecated:: 3.12
290+
.. deprecated-removed:: 3.12 3.14
291291

292292
.. c:var:: int Py_UnbufferedStdioFlag
293293
@@ -300,7 +300,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
300300
Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED`
301301
environment variable.
302302

303-
.. deprecated:: 3.12
303+
.. deprecated-removed:: 3.12 3.14
304304

305305
.. c:var:: int Py_VerboseFlag
306306
@@ -316,7 +316,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
316316
Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment
317317
variable.
318318

319-
.. deprecated:: 3.12
319+
.. deprecated-removed:: 3.12 3.14
320320

321321

322322
Initializing and finalizing the interpreter

Doc/c-api/type.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@ Type Objects
5050
The return type is now ``unsigned long`` rather than ``long``.
5151
5252
53+
.. c:function:: PyObject* PyType_GetDict(PyTypeObject* type)
54+
55+
Return the type object's internal namespace, which is otherwise only
56+
exposed via a read-only proxy (``cls.__dict__``). This is a
57+
replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly.
58+
The returned dictionary must be treated as read-only.
59+
60+
This function is meant for specific embedding and language-binding cases,
61+
where direct access to the dict is necessary and indirect access
62+
(e.g. via the proxy or :c:func:`PyObject_GetAttr`) isn't adequate.
63+
64+
Extension modules should continue to use ``tp_dict``,
65+
directly or indirectly, when setting up their own types.
66+
67+
.. versionadded:: 3.12
68+
69+
5370
.. c:function:: void PyType_Modified(PyTypeObject *type)
5471
5572
Invalidate the internal lookup cache for the type and all of its

Doc/c-api/typeobj.rst

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,27 +1143,27 @@ and :c:type:`PyType_Type` effectively act as defaults.)
11431143
:const:`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is
11441144
inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited.
11451145

1146-
.. data:: Py_TPFLAGS_MANAGED_DICT
1146+
.. data:: Py_TPFLAGS_MANAGED_DICT
11471147

1148-
This bit indicates that instances of the class have a ``__dict__``
1149-
attribute, and that the space for the dictionary is managed by the VM.
1148+
This bit indicates that instances of the class have a ``__dict__``
1149+
attribute, and that the space for the dictionary is managed by the VM.
11501150

1151-
If this flag is set, :const:`Py_TPFLAGS_HAVE_GC` should also be set.
1151+
If this flag is set, :const:`Py_TPFLAGS_HAVE_GC` should also be set.
11521152

1153-
.. versionadded:: 3.12
1153+
.. versionadded:: 3.12
11541154

11551155
**Inheritance:**
11561156

11571157
This flag is inherited unless the
11581158
:c:member:`~PyTypeObject.tp_dictoffset` field is set in a superclass.
11591159

11601160

1161-
.. data:: Py_TPFLAGS_MANAGED_WEAKREF
1161+
.. data:: Py_TPFLAGS_MANAGED_WEAKREF
11621162

1163-
This bit indicates that instances of the class should be weakly
1164-
referenceable.
1163+
This bit indicates that instances of the class should be weakly
1164+
referenceable.
11651165

1166-
.. versionadded:: 3.12
1166+
.. versionadded:: 3.12
11671167

11681168
**Inheritance:**
11691169

@@ -1717,7 +1717,19 @@ and :c:type:`PyType_Type` effectively act as defaults.)
17171717
called; it may also be initialized to a dictionary containing initial attributes
17181718
for the type. Once :c:func:`PyType_Ready` has initialized the type, extra
17191719
attributes for the type may be added to this dictionary only if they don't
1720-
correspond to overloaded operations (like :meth:`__add__`).
1720+
correspond to overloaded operations (like :meth:`__add__`). Once
1721+
initialization for the type has finished, this field should be
1722+
treated as read-only.
1723+
1724+
Some types may not store their dictionary in this slot.
1725+
Use :c:func:`PyType_GetDict` to retreive the dictionary for an arbitrary
1726+
type.
1727+
1728+
.. versionchanged:: 3.12
1729+
1730+
Internals detail: For static builtin types, this is always ``NULL``.
1731+
Instead, the dict for such types is stored on ``PyInterpreterState``.
1732+
Use :c:func:`PyType_GetDict` to get the dict for an arbitrary type.
17211733

17221734
**Inheritance:**
17231735

Doc/c-api/weakref.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ as much as it can.
5555
5656
Get a :term:`strong reference` to the referenced object from a weak
5757
reference, *ref*, into *\*pobj*.
58-
Return 0 on success. Raise an exception and return -1 on error.
5958
60-
If the referent is no longer live, set *\*pobj* to ``NULL`` and return 0.
59+
* On success, set *\*pobj* to a new :term:`strong reference` to the
60+
referenced object and return 1.
61+
* If the reference is dead, set *\*pobj* to ``NULL`` and return 0.
62+
* On error, raise an exception and return -1.
6163
6264
.. versionadded:: 3.13
6365

Doc/data/stable_abi.dat

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

Doc/glossary.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,21 @@ Glossary
11071107
when several are given, such as in ``variable_name[1:3:5]``. The bracket
11081108
(subscript) notation uses :class:`slice` objects internally.
11091109

1110+
soft deprecated
1111+
A soft deprecation can be used when using an API which should no longer
1112+
be used to write new code, but it remains safe to continue using it in
1113+
existing code. The API remains documented and tested, but will not be
1114+
developed further (no enhancement).
1115+
1116+
The main difference between a "soft" and a (regular) "hard" deprecation
1117+
is that the soft deprecation does not imply scheduling the removal of the
1118+
deprecated API.
1119+
1120+
Another difference is that a soft deprecation does not issue a warning.
1121+
1122+
See `PEP 387: Soft Deprecation
1123+
<https://peps.python.org/pep-0387/#soft-deprecation>`_.
1124+
11101125
special method
11111126
.. index:: pair: special; method
11121127

Doc/library/asyncio-exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Exceptions
3131

3232
.. versionchanged:: 3.8
3333

34-
:exc:`CancelledError` is now a subclass of :class:`BaseException`.
34+
:exc:`CancelledError` is now a subclass of :class:`BaseException` rather than :class:`Exception`.
3535

3636

3737
.. exception:: InvalidStateError

0 commit comments

Comments
 (0)