Skip to content

Commit dfcb761

Browse files
authored
Merge branch 'main' into add-reference-to-string-escapes-in-re-module-docs
2 parents 691e371 + 149748e commit dfcb761

Some content is hidden

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

58 files changed

+581
-236
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
types_or: [c, python, rst]
1111

1212
- repo: https://github.com/sphinx-contrib/sphinx-lint
13-
rev: v0.6.7
13+
rev: v0.6.8
1414
hooks:
1515
- id: sphinx-lint
1616
args: [--enable=default-role]

Doc/library/re.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ The special characters are:
501501
in the ASCII range (``b'\x00'``-``b'\x7f'``).
502502

503503

504+
.. _re-special-sequences:
505+
504506
The special sequences consist of ``'\'`` and a character from the list below.
505507
If the ordinary character is not an ASCII digit or an ASCII letter, then the
506508
resulting RE will match the second character. For example, ``\$`` matches the
@@ -779,6 +781,17 @@ Flags
779781
Corresponds to the inline flag ``(?s)``.
780782

781783

784+
.. data:: U
785+
UNICODE
786+
787+
In Python 2, this flag made :ref:`special sequences <re-special-sequences>`
788+
include Unicode characters in matches. Since Python 3, Unicode characters
789+
are matched by default.
790+
791+
See :const:`A` for restricting matching on ASCII characters instead.
792+
793+
This flag is only kept for backward compatibility.
794+
782795
.. data:: X
783796
VERBOSE
784797

@@ -1520,14 +1533,14 @@ Simulating scanf()
15201533

15211534
.. index:: single: scanf()
15221535

1523-
Python does not currently have an equivalent to :c:func:`scanf`. Regular
1536+
Python does not currently have an equivalent to :c:func:`!scanf`. Regular
15241537
expressions are generally more powerful, though also more verbose, than
1525-
:c:func:`scanf` format strings. The table below offers some more-or-less
1526-
equivalent mappings between :c:func:`scanf` format tokens and regular
1538+
:c:func:`!scanf` format strings. The table below offers some more-or-less
1539+
equivalent mappings between :c:func:`!scanf` format tokens and regular
15271540
expressions.
15281541

15291542
+--------------------------------+---------------------------------------------+
1530-
| :c:func:`scanf` Token | Regular Expression |
1543+
| :c:func:`!scanf` Token | Regular Expression |
15311544
+================================+=============================================+
15321545
| ``%c`` | ``.`` |
15331546
+--------------------------------+---------------------------------------------+
@@ -1552,7 +1565,7 @@ To extract the filename and numbers from a string like ::
15521565

15531566
/usr/sbin/sendmail - 0 errors, 4 warnings
15541567

1555-
you would use a :c:func:`scanf` format like ::
1568+
you would use a :c:func:`!scanf` format like ::
15561569

15571570
%s - %d errors, %d warnings
15581571

Doc/library/ssl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ disabled by default.
25922592
>>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3
25932593

25942594

2595-
The SSL context created above will only allow TLSv1.2 and later (if
2595+
The SSL context created above will only allow TLSv1.3 and later (if
25962596
supported by your system) connections to a server. :const:`PROTOCOL_TLS_CLIENT`
25972597
implies certificate validation and hostname checks by default. You have to
25982598
load certificates into the context.

Doc/library/turtle.rst

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,27 @@
1919
Introduction
2020
============
2121

22-
Turtle graphics is a popular way for introducing programming to kids. It was
23-
part of the original Logo programming language developed by Wally Feurzeig,
24-
Seymour Papert and Cynthia Solomon in 1967.
22+
Turtle graphics is an implementation of `the popular geometric drawing tools
23+
introduced in Logo <https://en.wikipedia.org/wiki/Turtle_
24+
(robot)>`_, developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon
25+
in 1967.
26+
27+
In Python, turtle graphics provides a representation of a physical "turtle"
28+
(a little robot with a pen) that draws on a sheet of paper on the floor.
29+
30+
It's an effective and well-proven way for learners to encounter
31+
programming concepts and interaction with software, as it provides instant,
32+
visible feedback. It also provides convenient access to graphical output
33+
in general.
34+
35+
Turtle drawing was originally created as an educational tool, to be used by
36+
teachers in the classroom. For the programmer who needs to produce some
37+
graphical output it can be a way to do that without the overhead of
38+
introducing more complex or external libraries into their work.
39+
40+
41+
Get started
42+
===========
2543

2644
Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it the
2745
command ``turtle.forward(15)``, and it moves (on-screen!) 15 pixels in the

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ Doc/library/pyclbr.rst
174174
Doc/library/pydoc.rst
175175
Doc/library/pyexpat.rst
176176
Doc/library/random.rst
177-
Doc/library/re.rst
178177
Doc/library/readline.rst
179178
Doc/library/reprlib.rst
180179
Doc/library/resource.rst

Doc/tutorial/errors.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,20 @@ of a certain type while letting all other exceptions propagate to
535535
other clauses and eventually to be reraised. ::
536536

537537
>>> def f():
538-
... raise ExceptionGroup("group1",
539-
... [OSError(1),
540-
... SystemError(2),
541-
... ExceptionGroup("group2",
542-
... [OSError(3), RecursionError(4)])])
538+
... raise ExceptionGroup(
539+
... "group1",
540+
... [
541+
... OSError(1),
542+
... SystemError(2),
543+
... ExceptionGroup(
544+
... "group2",
545+
... [
546+
... OSError(3),
547+
... RecursionError(4)
548+
... ]
549+
... )
550+
... ]
551+
... )
543552
...
544553
>>> try:
545554
... f()

Doc/whatsnew/3.10.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ Other Language Changes
887887
New Modules
888888
===========
889889
890-
* None yet.
890+
* None.
891891
892892
893893
Improved Modules

Doc/whatsnew/3.12.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
What's New In Python 3.12
44
****************************
55

6-
:Release: |release|
7-
:Date: |today|
6+
:Editor: TBD
87

98
.. Rules for maintenance:
109
@@ -486,7 +485,7 @@ Other Language Changes
486485
New Modules
487486
===========
488487

489-
* None yet.
488+
* None.
490489

491490

492491
Improved Modules

Doc/whatsnew/3.13.rst

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
What's New In Python 3.13
44
****************************
55

6-
:Release: |release|
7-
:Date: |today|
6+
:Editor: TBD
87

98
.. Rules for maintenance:
109
@@ -150,30 +149,7 @@ Optimizations
150149
Deprecated
151150
==========
152151

153-
* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
154-
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
155-
They will be removed in Python 3.15.
156-
(Contributed by Victor Stinner in :gh:`105096`.)
157-
* :mod:`typing`: Creating a :class:`typing.NamedTuple` class using keyword arguments to denote
158-
the fields (``NT = NamedTuple("NT", x=int, y=int)``) is deprecated, and will
159-
be disallowed in Python 3.15. Use the class-based syntax or the functional
160-
syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)
161-
* :mod:`typing`: When using the functional syntax to create a :class:`typing.NamedTuple`
162-
class or a :class:`typing.TypedDict` class, failing to pass a value to the
163-
'fields' parameter (``NT = NamedTuple("NT")`` or ``TD = TypedDict("TD")``) is
164-
deprecated. Passing ``None`` to the 'fields' parameter
165-
(``NT = NamedTuple("NT", None)`` or ``TD = TypedDict("TD", None)``) is also
166-
deprecated. Both will be disallowed in Python 3.15. To create a NamedTuple
167-
class with 0 fields, use ``class NT(NamedTuple): pass`` or
168-
``NT = NamedTuple("NT", [])``. To create a TypedDict class with 0 fields, use
169-
``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``.
170-
(Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)
171-
* :func:`typing.no_type_check_decorator` is deprecated, and scheduled for
172-
removal in Python 3.15. After eight years in the :mod:`typing` module, it
173-
has yet to be supported by any major type checkers.
174-
(Contributed by Alex Waygood in :gh:`106309`.)
175-
176-
* :mod:`array`'s ``'u'`` format code, deprecated in docs since Python 3.3,
152+
* :mod:`array`: :mod:`array`'s ``'u'`` format code, deprecated in docs since Python 3.3,
177153
emits :exc:`DeprecationWarning` since 3.13
178154
and will be removed in Python 3.16.
179155
Use the ``'w'`` format code instead.
@@ -184,13 +160,39 @@ Deprecated
184160
Replace ``ctypes.ARRAY(item_type, size)`` with ``item_type * size``.
185161
(Contributed by Victor Stinner in :gh:`105733`.)
186162

187-
* The :mod:`getopt` and :mod:`optparse` modules are now
163+
* :mod:`getopt` and :mod:`optparse` modules: They are now
188164
:term:`soft deprecated`: the :mod:`argparse` should be used for new projects.
189165
Previously, the :mod:`optparse` module was already deprecated, its removal
190166
was not scheduled, and no warnings was emitted: so there is no change in
191167
practice.
192168
(Contributed by Victor Stinner in :gh:`106535`.)
193169

170+
* :mod:`typing`: Creating a :class:`typing.NamedTuple` class using keyword arguments to denote
171+
the fields (``NT = NamedTuple("NT", x=int, y=int)``) is deprecated, and will
172+
be disallowed in Python 3.15. Use the class-based syntax or the functional
173+
syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)
174+
175+
* When using the functional syntax to create a :class:`typing.NamedTuple`
176+
class or a :class:`typing.TypedDict` class, failing to pass a value to the
177+
'fields' parameter (``NT = NamedTuple("NT")`` or ``TD = TypedDict("TD")``) is
178+
deprecated. Passing ``None`` to the 'fields' parameter
179+
(``NT = NamedTuple("NT", None)`` or ``TD = TypedDict("TD", None)``) is also
180+
deprecated. Both will be disallowed in Python 3.15. To create a NamedTuple
181+
class with 0 fields, use ``class NT(NamedTuple): pass`` or
182+
``NT = NamedTuple("NT", [])``. To create a TypedDict class with 0 fields, use
183+
``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``.
184+
(Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)
185+
186+
* :func:`typing.no_type_check_decorator` is deprecated, and scheduled for
187+
removal in Python 3.15. After eight years in the :mod:`typing` module, it
188+
has yet to be supported by any major type checkers.
189+
(Contributed by Alex Waygood in :gh:`106309`.)
190+
191+
* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
192+
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
193+
They will be removed in Python 3.15.
194+
(Contributed by Victor Stinner in :gh:`105096`.)
195+
194196
Pending Removal in Python 3.14
195197
------------------------------
196198

@@ -835,6 +837,13 @@ Deprecated
835837
Removed
836838
-------
837839

840+
* Remove many APIs (functions, macros, variables) with names prefixed by
841+
``_Py`` or ``_PY`` (considered as private API). If your project is affected
842+
by one of these removals and you consider that the removed API should remain
843+
available, please open a new issue to request a public C API and
844+
add ``cc @vstinner`` to the issue to notify Victor Stinner.
845+
(Contributed by Victor Stinner in :gh:`106320`.)
846+
838847
* Remove functions deprecated in Python 3.9.
839848

840849
* ``PyEval_CallObject()``, ``PyEval_CallObjectWithKeywords()``: use

Include/cpython/genobject.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ PyAPI_DATA(PyTypeObject) PyGen_Type;
4141
PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *);
4242
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
4343
PyObject *name, PyObject *qualname);
44-
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
45-
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
46-
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
4744
PyAPI_FUNC(PyCodeObject *) PyGen_GetCode(PyGenObject *gen);
4845

4946

@@ -54,7 +51,6 @@ typedef struct {
5451
} PyCoroObject;
5552

5653
PyAPI_DATA(PyTypeObject) PyCoro_Type;
57-
PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type;
5854

5955
#define PyCoro_CheckExact(op) Py_IS_TYPE((op), &PyCoro_Type)
6056
PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *,
@@ -69,8 +65,6 @@ typedef struct {
6965

7066
PyAPI_DATA(PyTypeObject) PyAsyncGen_Type;
7167
PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type;
72-
PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type;
73-
PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type;
7468

7569
PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *,
7670
PyObject *name, PyObject *qualname);

0 commit comments

Comments
 (0)