Skip to content

Commit c540f28

Browse files
committed
Merge branch 'main' into use-stackrefs
2 parents 806c28a + 023b7d2 commit c540f28

Some content is hidden

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

49 files changed

+632
-417
lines changed

Doc/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@
7878
.. |python_version_literal| replace:: ``Python {version}``
7979
.. |python_x_dot_y_literal| replace:: ``python{version}``
8080
.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``
81+
82+
.. Apparently this how you hack together a formatted link:
83+
(https://www.docutils.org/docs/ref/rst/directives.html#replacement-text)
84+
.. |FORCE_COLOR| replace:: ``FORCE_COLOR``
85+
.. _FORCE_COLOR: https://force-color.org/
86+
.. |NO_COLOR| replace:: ``NO_COLOR``
87+
.. _NO_COLOR: https://no-color.org/
8188
"""
8289

8390
# There are two options for replacing |today|. Either, you set today to some

Doc/howto/gdb_helpers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ regular machine-level integer::
180180
(gdb) p some_python_integer
181181
$4 = 42
182182

183-
The internal structure can be revealed with a cast to :c:expr:`PyLongObject *`:
183+
The internal structure can be revealed with a cast to :c:expr:`PyLongObject *`::
184184

185185
(gdb) p *(PyLongObject*)some_python_integer
186186
$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size = 1},

Doc/library/dis.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ interpreter.
6060
The :option:`-P <dis --show-positions>` command-line option
6161
and the ``show_positions`` argument were added.
6262

63+
The :option:`-S <dis --specialized>` command-line option is added.
64+
6365
Example: Given the function :func:`!myfunc`::
6466

6567
def myfunc(alist):
@@ -89,7 +91,7 @@ The :mod:`dis` module can be invoked as a script from the command line:
8991

9092
.. code-block:: sh
9193
92-
python -m dis [-h] [-C] [-O] [-P] [infile]
94+
python -m dis [-h] [-C] [-O] [-P] [-S] [infile]
9395
9496
The following options are accepted:
9597

@@ -111,6 +113,10 @@ The following options are accepted:
111113

112114
Show positions of instructions in the source code.
113115

116+
.. cmdoption:: -S, --specialized
117+
118+
Show specialized bytecode.
119+
114120
If :file:`infile` is specified, its disassembled code will be written to stdout.
115121
Otherwise, disassembly is performed on compiled source code received from stdin.
116122

Doc/library/doctest.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ examples of doctests in the standard Python test suite and libraries.
136136
Especially useful examples can be found in the standard test file
137137
:file:`Lib/test/test_doctest/test_doctest.py`.
138138

139+
.. versionadded:: 3.13
140+
Output is colorized by default and can be
141+
:ref:`controlled using environment variables <using-on-controlling-color>`.
142+
139143

140144
.. _doctest-simple-testmod:
141145

Doc/library/pathlib.rst

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,35 +1289,6 @@ Reading directories
12891289
raised.
12901290

12911291

1292-
.. method:: Path.scandir()
1293-
1294-
When the path points to a directory, return an iterator of
1295-
:class:`os.DirEntry` objects corresponding to entries in the directory. The
1296-
returned iterator supports the :term:`context manager` protocol. It is
1297-
implemented using :func:`os.scandir` and gives the same guarantees.
1298-
1299-
Using :meth:`~Path.scandir` instead of :meth:`~Path.iterdir` can
1300-
significantly increase the performance of code that also needs file type or
1301-
file attribute information, because :class:`os.DirEntry` objects expose
1302-
this information if the operating system provides it when scanning a
1303-
directory.
1304-
1305-
The following example displays the names of subdirectories. The
1306-
``entry.is_dir()`` check will generally not make an additional system call::
1307-
1308-
>>> p = Path('docs')
1309-
>>> with p.scandir() as entries:
1310-
... for entry in entries:
1311-
... if entry.is_dir():
1312-
... entry.name
1313-
...
1314-
'_templates'
1315-
'_build'
1316-
'_static'
1317-
1318-
.. versionadded:: 3.14
1319-
1320-
13211292
.. method:: Path.glob(pattern, *, case_sensitive=None, recurse_symlinks=False)
13221293

13231294
Glob the given relative *pattern* in the directory represented by this path,

Doc/library/traceback.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ The module's API can be divided into two parts:
4444
necessary for later formatting without holding references to actual exception
4545
and traceback objects.
4646

47+
.. versionadded:: 3.13
48+
Output is colorized by default and can be
49+
:ref:`controlled using environment variables <using-on-controlling-color>`.
50+
4751

4852
Module-Level Functions
4953
----------------------

Doc/library/unittest.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ test runner
4646
a textual interface, or return a special value to indicate the results of
4747
executing the tests.
4848

49-
5049
.. seealso::
5150

5251
Module :mod:`doctest`
@@ -198,6 +197,9 @@ For a list of all the command-line options::
198197
In earlier versions it was only possible to run individual test methods and
199198
not modules or classes.
200199

200+
.. versionadded:: 3.14
201+
Output is colorized by default and can be
202+
:ref:`controlled using environment variables <using-on-controlling-color>`.
201203

202204
Command-line options
203205
~~~~~~~~~~~~~~~~~~~~

Doc/using/cmdline.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,6 @@ output. To control the color output only in the Python interpreter, the
663663
precedence over ``NO_COLOR``, which in turn takes precedence over
664664
``FORCE_COLOR``.
665665

666-
.. Apparently this how you hack together a formatted link:
667-
668-
.. |FORCE_COLOR| replace:: ``FORCE_COLOR``
669-
.. _FORCE_COLOR: https://force-color.org/
670-
671-
.. |NO_COLOR| replace:: ``NO_COLOR``
672-
.. _NO_COLOR: https://no-color.org/
673-
674666
Options you shouldn't use
675667
~~~~~~~~~~~~~~~~~~~~~~~~~
676668

Doc/whatsnew/3.13.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,6 @@ Improved error messages
252252
the canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables.
253253
(Contributed by Pablo Galindo Salgado in :gh:`112730`.)
254254

255-
.. Apparently this how you hack together a formatted link:
256-
(https://www.docutils.org/docs/ref/rst/directives.html#replacement-text)
257-
258-
.. |FORCE_COLOR| replace:: ``FORCE_COLOR``
259-
.. _FORCE_COLOR: https://force-color.org/
260-
261-
.. |NO_COLOR| replace:: ``NO_COLOR``
262-
.. _NO_COLOR: https://no-color.org/
263-
264255
* A common mistake is to write a script with the same name as a
265256
standard library module. When this results in errors, we now
266257
display a more helpful error message:

Doc/whatsnew/3.14.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,18 @@ dis
348348
This feature is also exposed via :option:`dis --show-positions`.
349349
(Contributed by Bénédikt Tran in :gh:`123165`.)
350350

351+
* Add the :option:`dis --specialized` command-line option to
352+
show specialized bytecode.
353+
(Contributed by Bénédikt Tran in :gh:`127413`.)
354+
355+
351356
errno
352357
-----
353358

354359
* Add :data:`errno.EHWPOISON` error code.
355360
(Contributed by James Roy in :gh:`126585`.)
356361

362+
357363
fractions
358364
---------
359365

@@ -526,12 +532,6 @@ pathlib
526532

527533
(Contributed by Barney Gale in :gh:`73991`.)
528534

529-
* Add :meth:`pathlib.Path.scandir` to scan a directory and return an iterator
530-
of :class:`os.DirEntry` objects. This is exactly equivalent to calling
531-
:func:`os.scandir` on a path object.
532-
533-
(Contributed by Barney Gale in :gh:`125413`.)
534-
535535

536536
pdb
537537
---
@@ -610,6 +610,13 @@ unicodedata
610610
unittest
611611
--------
612612

613+
* :mod:`unittest` output is now colored by default.
614+
This can be controlled via the :envvar:`PYTHON_COLORS` environment
615+
variable as well as the canonical |NO_COLOR|_
616+
and |FORCE_COLOR|_ environment variables.
617+
See also :ref:`using-on-controlling-color`.
618+
(Contributed by Hugo van Kemenade in :gh:`127221`.)
619+
613620
* unittest discovery supports :term:`namespace package` as start
614621
directory again. It was removed in Python 3.11.
615622
(Contributed by Jacob Walls in :gh:`80958`.)

0 commit comments

Comments
 (0)