Skip to content

Commit 203c135

Browse files
Merge remote-tracking branch 'upstream/main' into pop_top_calls
2 parents 82f4d15 + 1a0edb1 commit 203c135

30 files changed

+1400
-1463
lines changed

Doc/c-api/unicode.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,10 @@ object.
18811881
On success, return ``0``.
18821882
On error, set an exception, leave the writer unchanged, and return ``-1``.
18831883
1884+
To write a :class:`str` subclass which overrides the :meth:`~object.__str__`
1885+
method, :c:func:`PyUnicode_FromObject` can be used to get the original
1886+
string.
1887+
18841888
.. c:function:: int PyUnicodeWriter_WriteRepr(PyUnicodeWriter *writer, PyObject *obj)
18851889
18861890
Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*.

Doc/library/asyncio-future.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ Future Object
196196
Otherwise, change the Future's state to *cancelled*,
197197
schedule the callbacks, and return ``True``.
198198

199+
The optional string argument *msg* is passed as the argument to the
200+
:exc:`CancelledError` exception raised when a cancelled Future
201+
is awaited.
202+
199203
.. versionchanged:: 3.9
200204
Added the *msg* parameter.
201205

Doc/library/stdtypes.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,8 +2775,22 @@ expression support in the :mod:`re` module).
27752775
.. method:: str.swapcase()
27762776

27772777
Return a copy of the string with uppercase characters converted to lowercase and
2778-
vice versa. Note that it is not necessarily true that
2779-
``s.swapcase().swapcase() == s``.
2778+
vice versa. For example:
2779+
2780+
.. doctest::
2781+
2782+
>>> 'Hello World'.swapcase()
2783+
'hELLO wORLD'
2784+
2785+
Note that it is not necessarily true that ``s.swapcase().swapcase() == s``.
2786+
For example:
2787+
2788+
.. doctest::
2789+
2790+
>>> 'straße'.swapcase().swapcase()
2791+
'strasse'
2792+
2793+
See also :meth:`str.lower` and :meth:`str.upper`.
27802794

27812795

27822796
.. method:: str.title()

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)