Skip to content

Commit 6a25717

Browse files
Merge pull request #3 from python/main
pull
2 parents 2b803bc + ee46cb6 commit 6a25717

Some content is hidden

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

60 files changed

+1843
-666
lines changed

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/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/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/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ are always available. They are listed here in alphabetical order.
794794

795795
For objects with custom :meth:`__hash__` methods, note that :func:`hash`
796796
truncates the return value based on the bit width of the host machine.
797-
See :meth:`__hash__` for details.
797+
See :meth:`__hash__ <object.__hash__>` for details.
798798

799799
.. function:: help()
800800
help(request)

Doc/library/getopt.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77

88
**Source code:** :source:`Lib/getopt.py`
99

10+
.. deprecated:: 3.13
11+
The :mod:`getopt` module is :term:`soft deprecated` and will not be
12+
developed further; development will continue with the :mod:`argparse`
13+
module.
14+
1015
.. note::
1116

1217
The :mod:`getopt` module is a parser for command line options whose API is
13-
designed to be familiar to users of the C :c:func:`getopt` function. Users who
14-
are unfamiliar with the C :c:func:`getopt` function or who would like to write
18+
designed to be familiar to users of the C :c:func:`!getopt` function. Users who
19+
are unfamiliar with the C :c:func:`!getopt` function or who would like to write
1520
less code and get better help and error messages should consider using the
1621
:mod:`argparse` module instead.
1722

1823
--------------
1924

2025
This module helps scripts to parse the command line arguments in ``sys.argv``.
21-
It supports the same conventions as the Unix :c:func:`getopt` function (including
26+
It supports the same conventions as the Unix :c:func:`!getopt` function (including
2227
the special meanings of arguments of the form '``-``' and '``--``'). Long
2328
options similar to those supported by GNU software may be used as well via an
2429
optional third argument.
@@ -33,11 +38,11 @@ exception:
3338
be parsed, without the leading reference to the running program. Typically, this
3439
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
3540
script wants to recognize, with options that require an argument followed by a
36-
colon (``':'``; i.e., the same format that Unix :c:func:`getopt` uses).
41+
colon (``':'``; i.e., the same format that Unix :c:func:`!getopt` uses).
3742

3843
.. note::
3944

40-
Unlike GNU :c:func:`getopt`, after a non-option argument, all further
45+
Unlike GNU :c:func:`!getopt`, after a non-option argument, all further
4146
arguments are considered also non-options. This is similar to the way
4247
non-GNU Unix systems work.
4348

@@ -71,7 +76,7 @@ exception:
7176
non-option argument is encountered.
7277

7378
If the first character of the option string is ``'+'``, or if the environment
74-
variable :envvar:`POSIXLY_CORRECT` is set, then option processing stops as
79+
variable :envvar:`!POSIXLY_CORRECT` is set, then option processing stops as
7580
soon as a non-option argument is encountered.
7681

7782

@@ -81,9 +86,9 @@ exception:
8186
an option requiring an argument is given none. The argument to the exception is
8287
a string indicating the cause of the error. For long options, an argument given
8388
to an option which does not require one will also cause this exception to be
84-
raised. The attributes :attr:`msg` and :attr:`opt` give the error message and
89+
raised. The attributes :attr:`!msg` and :attr:`!opt` give the error message and
8590
related option; if there is no specific option to which the exception relates,
86-
:attr:`opt` is an empty string.
91+
:attr:`!opt` is an empty string.
8792

8893
.. XXX deprecated?
8994
.. exception:: error

Doc/library/logging.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,10 @@ interchangeably.
10151015
Attribute :attr:`manager` and method :meth:`_log` were added, which
10161016
delegate to the underlying logger and allow adapters to be nested.
10171017

1018+
.. versionchanged:: 3.13
1019+
Remove the undocumented ``warn()`` method which was an alias to the
1020+
``warning()`` method.
1021+
10181022

10191023
Thread Safety
10201024
-------------
@@ -1162,6 +1166,10 @@ functions.
11621166
identical to ``warning``. As ``warn`` is deprecated, please do not use
11631167
it - use ``warning`` instead.
11641168

1169+
.. versionchanged:: 3.13
1170+
Remove the undocumented ``warn()`` function which was an alias to the
1171+
:func:`warning` function.
1172+
11651173

11661174
.. function:: error(msg, *args, **kwargs)
11671175

Doc/library/optparse.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
**Source code:** :source:`Lib/optparse.py`
1212

1313
.. deprecated:: 3.2
14-
The :mod:`optparse` module is deprecated and will not be developed further;
15-
development will continue with the :mod:`argparse` module.
14+
The :mod:`optparse` module is :term:`soft deprecated` and will not be
15+
developed further; development will continue with the :mod:`argparse`
16+
module.
1617

1718
--------------
1819

0 commit comments

Comments
 (0)