Skip to content

Commit 59ee601

Browse files
authored
Merge branch 'main' into emscripten-trampoline-static
2 parents fe2b470 + 9bd670c commit 59ee601

89 files changed

Lines changed: 1836 additions & 850 deletions

File tree

Some content is hidden

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

Doc/c-api/module.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ struct:
853853
854854
.. versionadded:: 3.5
855855
856-
.. soft-deprecated:: next
856+
.. soft-deprecated:: 3.15
857857
858858
Prefer :c:func:`PyModule_FromSlotsAndSpec` in new code.
859859
@@ -877,7 +877,7 @@ struct:
877877
878878
.. versionadded:: 3.5
879879
880-
.. soft-deprecated:: next
880+
.. soft-deprecated:: 3.15
881881
882882
Prefer :c:func:`PyModule_FromSlotsAndSpec` in new code.
883883
@@ -887,7 +887,7 @@ struct:
887887
888888
.. versionadded:: 3.5
889889
890-
.. soft-deprecated:: next
890+
.. soft-deprecated:: 3.15
891891
892892
To run a module's own execution slots, prefer :c:func:`PyModule_Exec`,
893893
which works on modules that were not created from a

Doc/c-api/type.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ They will continue to work, but new features will be added as slots for
828828
829829
.. versionadded:: 3.12
830830
831-
.. soft-deprecated:: next
831+
.. soft-deprecated:: 3.15
832832
833833
Prefer :c:func:`PyType_FromSlots` in new code.
834834
@@ -859,7 +859,7 @@ They will continue to work, but new features will be added as slots for
859859
Creating classes whose metaclass overrides
860860
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
861861
862-
.. soft-deprecated:: next
862+
.. soft-deprecated:: 3.15
863863
864864
Prefer :c:func:`PyType_FromSlots` in new code.
865865
@@ -885,7 +885,7 @@ They will continue to work, but new features will be added as slots for
885885
Creating classes whose metaclass overrides
886886
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
887887
888-
.. soft-deprecated:: next
888+
.. soft-deprecated:: 3.15
889889
890890
Prefer :c:func:`PyType_FromSlots` in new code.
891891
@@ -910,7 +910,7 @@ They will continue to work, but new features will be added as slots for
910910
Creating classes whose metaclass overrides
911911
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
912912
913-
.. soft-deprecated:: next
913+
.. soft-deprecated:: 3.15
914914
915915
Prefer :c:func:`PyType_FromSlots` in new code.
916916

Doc/c-api/typeobj.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,9 +1869,10 @@ and :c:data:`PyType_Type` effectively act as defaults.)
18691869

18701870
PyObject *tp_iternext(PyObject *self);
18711871

1872-
When the iterator is exhausted, it must return ``NULL``; a :exc:`StopIteration`
1873-
exception may or may not be set. When another error occurs, it must return
1874-
``NULL`` too. Its presence signals that the instances of this type are
1872+
When the iterator is :term:`exhausted`, the ``tp_iternext`` function must
1873+
return ``NULL``; a :exc:`StopIteration` exception may or may not be set.
1874+
When another error occurs, it must return ``NULL`` too.
1875+
The presence of ``tp_iternext`` signals that the instances of this type are
18751876
iterators.
18761877

18771878
Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` function, and that

Doc/glossary.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,14 @@ Glossary
505505
of an object, such as the value of type aliases created with the :keyword:`type`
506506
statement.
507507

508+
exhausted
509+
An :term:`iterator` that has produced all of its values is said to be
510+
:dfn:`exhausted`.
511+
Further attempts to get the next value (for example, calls to
512+
:func:`next`) raise :exc:`StopIteration`
513+
(or :exc:`StopAsyncIteration` in the case of an :term:`asynchronous
514+
iterator`).
515+
508516
expression
509517
A piece of syntax which can be evaluated to some value. In other words,
510518
an expression is an accumulation of expression elements like literals,
@@ -869,7 +877,7 @@ Glossary
869877
:meth:`~iterator.__next__` method (or passing it to the built-in function
870878
:func:`next`) return successive items in the stream. When no more data
871879
are available a :exc:`StopIteration` exception is raised instead. At this
872-
point, the iterator object is exhausted and any further calls to its
880+
point, the iterator object is :term:`exhausted` and any further calls to its
873881
:meth:`!__next__` method just raise :exc:`StopIteration` again. Iterators
874882
are required to have an :meth:`~iterator.__iter__` method that returns the iterator
875883
object itself so every iterator is also iterable and may be used in most

Doc/howto/functional.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,10 @@ returns them in a tuple::
720720
zip(['a', 'b', 'c'], (1, 2, 3)) =>
721721
('a', 1), ('b', 2), ('c', 3)
722722

723-
It doesn't construct an in-memory list and exhaust all the input iterators
724-
before returning; instead tuples are constructed and returned only if they're
725-
requested. (The technical term for this behaviour is `lazy evaluation
723+
It doesn't construct an in-memory list and :term:`exhaust <exhausted>` all
724+
the input iterators before returning; instead tuples are constructed and
725+
returned only if they're requested.
726+
(The technical term for this behaviour is `lazy evaluation
726727
<https://en.wikipedia.org/wiki/Lazy_evaluation>`__.)
727728

728729
This iterator is intended to be used with iterables that are all of the same
@@ -783,7 +784,7 @@ element *n* times, or returns the element endlessly if *n* is not provided. ::
783784
:func:`itertools.chain(iterA, iterB, ...) <itertools.chain>` takes an arbitrary
784785
number of iterables as input, and returns all the elements of the first
785786
iterator, then all the elements of the second, and so on, until all of the
786-
iterables have been exhausted. ::
787+
iterables have been :term:`exhausted`. ::
787788

788789
itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>
789790
a, b, c, 1, 2, 3
@@ -878,7 +879,7 @@ iterable's results. ::
878879

879880
:func:`itertools.compress(data, selectors) <itertools.compress>` takes two
880881
iterators and returns only those elements of *data* for which the corresponding
881-
element of *selectors* is true, stopping whenever either one is exhausted::
882+
element of *selectors* is true, stopping whenever either one is :term:`exhausted`::
882883

883884
itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>
884885
1, 2, 5
@@ -1028,7 +1029,7 @@ that takes two elements and returns a single value. :func:`functools.reduce`
10281029
takes the first two elements A and B returned by the iterator and calculates
10291030
``func(A, B)``. It then requests the third element, C, calculates
10301031
``func(func(A, B), C)``, combines this result with the fourth element returned,
1031-
and continues until the iterable is exhausted. If the iterable returns no
1032+
and continues until the iterable is :term:`exhausted`. If the iterable returns no
10321033
values at all, a :exc:`TypeError` exception is raised. If the initial value is
10331034
supplied, it's used as a starting point and ``func(initial_value, A)`` is the
10341035
first calculation. ::

Doc/howto/logging-cookbook.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,7 @@ subclassed handler which looks something like this::
39203920

39213921
You'll need to be familiar with RFC 5424 to fully understand the above code, and it
39223922
may be that you have slightly different needs (e.g. for how you pass structural data
3923-
to the log). Nevertheless, the above should be adaptable to your speciric needs. With
3923+
to the log). Nevertheless, the above should be adaptable to your specific needs. With
39243924
the above handler, you'd pass structured data using something like this::
39253925

39263926
sd = {

Doc/howto/mro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ prescription:
189189
the tail of any of the other lists, then add it to the linearization
190190
of C and remove it from the lists in the merge, otherwise look at the
191191
head of the next list and take it, if it is a good head. Then repeat
192-
the operation until all the class are removed or it is impossible to
192+
the operation until all the classes are removed or it is impossible to
193193
find good heads. In this case, it is impossible to construct the
194194
merge, Python 2.3 will refuse to create the class C and will raise an
195195
exception.*

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ added elements by appending to the right and popping to the left::
699699
A `round-robin scheduler
700700
<https://en.wikipedia.org/wiki/Round-robin_scheduling>`_ can be implemented with
701701
input iterators stored in a :class:`deque`. Values are yielded from the active
702-
iterator in position zero. If that iterator is exhausted, it can be removed
702+
iterator in position zero. If that iterator is :term:`exhausted`, it can be removed
703703
with :meth:`~deque.popleft`; otherwise, it can be cycled back to the end with
704704
the :meth:`~deque.rotate` method::
705705

Doc/library/curses.rst

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,10 @@ Input options
326326

327327
The curses library does "line-breakout optimization" by looking for typeahead
328328
periodically while updating the screen. If input is found, and it is coming
329-
from a tty, the current update is postponed until refresh or doupdate is called
330-
again, allowing faster response to commands typed in advance. This function
331-
allows specifying a different file descriptor for typeahead checking.
329+
from a tty, the current update is postponed until :meth:`~window.refresh` or
330+
:func:`doupdate` is called again, allowing faster response to commands typed
331+
in advance. This function allows specifying a different file descriptor for
332+
typeahead checking.
332333

333334
.. function:: is_cbreak()
334335

@@ -702,7 +703,8 @@ labels.
702703
(eight labels). Where the underlying curses library supports them, ``2``
703704
gives 4-4-4 (twelve labels) and ``3`` gives 4-4-4 with an index line.
704705

705-
Must be called before :func:`initscr` or :func:`newterm`.
706+
Must be called before :func:`initscr` or :func:`newterm`,
707+
and affects only the screen created next.
706708

707709
.. versionadded:: next
708710

@@ -1067,8 +1069,10 @@ Utilities
10671069

10681070
.. function:: filter()
10691071

1070-
The :func:`.filter` routine, if used, must be called before :func:`initscr` is
1071-
called. The effect is that, during the initialization, :envvar:`LINES` is set to ``1``; the
1072+
The :func:`.filter` routine, if used, must be called before :func:`initscr`
1073+
or :func:`newterm` is called,
1074+
and affects every screen created afterwards.
1075+
The effect is that, during the initialization, :envvar:`LINES` is set to ``1``; the
10721076
capabilities ``clear``, ``cup``, ``cud``, ``cud1``, ``cuu1``, ``cuu``, ``vpa`` are disabled; and the ``home``
10731077
string is set to the value of ``cr``. The effect is that the cursor is confined to
10741078
the current line, and so are screen updates. This may be used for enabling
@@ -1087,8 +1091,10 @@ Utilities
10871091

10881092
.. function:: use_env(flag)
10891093

1090-
If used, this function should be called before :func:`initscr` or newterm are
1091-
called. When *flag* is ``False``, the values of lines and columns specified in the
1094+
If used, this function should be called before :func:`initscr` or
1095+
:func:`newterm` are called,
1096+
and affects every screen created afterwards.
1097+
When *flag* is ``False``, the values of lines and columns specified in the
10921098
terminfo database will be used, even if environment variables :envvar:`LINES`
10931099
and :envvar:`COLUMNS` (used by default) are set, or if curses is running in a
10941100
window (in which case default behavior would be to use the window size if
@@ -1106,6 +1112,9 @@ Utilities
11061112
to distinguish between an individual escape character entered on the
11071113
keyboard from escape sequences sent by cursor and function keys.
11081114

1115+
Depending on the curses library, the setting may apply to all screens,
1116+
not only to the current one.
1117+
11091118
.. versionadded:: 3.9
11101119

11111120
.. function:: get_tabsize()
@@ -1119,6 +1128,9 @@ Utilities
11191128
Sets the number of columns used by the curses library when converting a tab
11201129
character to spaces as it adds the tab to a window.
11211130

1131+
Depending on the curses library, the setting may apply to all screens,
1132+
not only to the current one, and creating a screen may reset it.
1133+
11221134
.. versionadded:: 3.9
11231135

11241136
.. function:: napms(ms)

Doc/library/dis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ iterations of the loop.
14271427

14281428
``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` method.
14291429
If this yields a new value, push it on the stack (leaving the iterator below
1430-
it). If the iterator indicates it is exhausted then the byte code counter is
1430+
it). If the iterator indicates it is :term:`exhausted` then the byte code counter is
14311431
incremented by *delta*.
14321432

14331433
.. versionchanged:: 3.12

0 commit comments

Comments
 (0)