Skip to content

Commit 1f6d422

Browse files
committed
Deploying to gh-pages from @ 9264e88 🚀
1 parent 4f13263 commit 1f6d422

File tree

552 files changed

+1385
-882
lines changed

Some content is hidden

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

552 files changed

+1385
-882
lines changed

_sources/bugs.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ though it may take a while to be processed.
3838
`Helping with Documentation <https://devguide.python.org/docquality/#helping-with-documentation>`_
3939
Comprehensive guide for individuals that are interested in contributing to Python documentation.
4040

41-
`Documentation Translations <https://devguide.python.org/documenting/#translating>`_
41+
`Documentation Translations <https://devguide.python.org/documentation/translating/>`_
4242
A list of GitHub pages for documentation translation and their primary contacts.
4343

4444

_sources/c-api/exceptions.rst.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,17 @@ Printing and clearing
8888
The function is called with a single argument *obj* that identifies the context
8989
in which the unraisable exception occurred. If possible,
9090
the repr of *obj* will be printed in the warning message.
91+
If *obj* is ``NULL``, only the traceback is printed.
9192
9293
An exception must be set when calling this function.
9394
95+
.. versionchanged:: 3.4
96+
Print a traceback. Print only traceback if *obj* is ``NULL``.
97+
98+
.. versionchanged:: 3.8
99+
Use :func:`sys.unraisablehook`.
100+
101+
94102
.. c:function:: void PyErr_DisplayException(PyObject *exc)
95103
96104
Print the standard traceback display of ``exc`` to ``sys.stderr``, including

_sources/howto/descriptor.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,10 @@ it can be updated:
943943
>>> Movie('Star Wars').director
944944
'J.J. Abrams'
945945

946+
.. testcleanup::
947+
948+
conn.close()
949+
946950

947951
Pure Python Equivalents
948952
^^^^^^^^^^^^^^^^^^^^^^^

_sources/howto/enum.rst.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ Dataclass support
483483
When inheriting from a :class:`~dataclasses.dataclass`,
484484
the :meth:`~Enum.__repr__` omits the inherited class' name. For example::
485485

486+
>>> from dataclasses import dataclass, field
486487
>>> @dataclass
487488
... class CreatureDataMixin:
488489
... size: str
@@ -527,7 +528,8 @@ It is possible to modify how enum members are pickled/unpickled by defining
527528
:meth:`__reduce_ex__` in the enumeration class. The default method is by-value,
528529
but enums with complicated values may want to use by-name::
529530

530-
>>> class MyEnum(Enum):
531+
>>> import enum
532+
>>> class MyEnum(enum.Enum):
531533
... __reduce_ex__ = enum.pickle_by_enum_name
532534

533535
.. note::
@@ -770,7 +772,7 @@ be combined with them (but may lose :class:`IntFlag` membership::
770772
>>> Perm.X | 4
771773
<Perm.R|X: 5>
772774

773-
>>> Perm.X | 8
775+
>>> Perm.X + 8
774776
9
775777

776778
.. note::
@@ -1435,8 +1437,9 @@ alias::
14351437
... GRENE = 2
14361438
...
14371439
Traceback (most recent call last):
1438-
...
1440+
...
14391441
ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
1442+
Error calling __set_name__ on '_proto_member' instance 'GRENE' in 'Color'
14401443

14411444
.. note::
14421445

_sources/library/asyncio-eventloop.rst.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Opening network connections
509509

510510
.. versionchanged:: 3.6
511511

512-
The socket option :py:const:`~socket.TCP_NODELAY` is set by default
512+
The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default
513513
for all TCP connections.
514514

515515
.. versionchanged:: 3.7
@@ -581,7 +581,7 @@ Opening network connections
581581
* *reuse_port* tells the kernel to allow this endpoint to be bound to the
582582
same port as other existing endpoints are bound to, so long as they all
583583
set this flag when being created. This option is not supported on Windows
584-
and some Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not
584+
and some Unixes. If the :ref:`socket.SO_REUSEPORT <socket-unix-constants>` constant is not
585585
defined then this capability is unsupported.
586586

587587
* *allow_broadcast* tells the kernel to allow this endpoint to send
@@ -607,7 +607,8 @@ Opening network connections
607607

608608
.. versionchanged:: 3.8.1
609609
The *reuse_address* parameter is no longer supported, as using
610-
:py:const:`~sockets.SO_REUSEADDR` poses a significant security concern for
610+
:ref:`socket.SO_REUSEADDR <socket-unix-constants>`
611+
poses a significant security concern for
611612
UDP. Explicitly passing ``reuse_address=True`` will raise an exception.
612613

613614
When multiple processes with differing UIDs assign sockets to an
@@ -616,7 +617,8 @@ Opening network connections
616617

617618
For supported platforms, *reuse_port* can be used as a replacement for
618619
similar functionality. With *reuse_port*,
619-
:py:const:`~sockets.SO_REUSEPORT` is used instead, which specifically
620+
:ref:`socket.SO_REUSEPORT <socket-unix-constants>`
621+
is used instead, which specifically
620622
prevents processes with differing UIDs from assigning sockets to the same
621623
socket address.
622624

@@ -758,7 +760,7 @@ Creating network servers
758760
.. versionchanged:: 3.6
759761

760762
Added *ssl_handshake_timeout* and *start_serving* parameters.
761-
The socket option :py:const:`~socket.TCP_NODELAY` is set by default
763+
The socket option :ref:`socket.TCP_NODELAY <socket-unix-constants>` is set by default
762764
for all TCP connections.
763765

764766
.. versionchanged:: 3.11
@@ -1619,8 +1621,9 @@ Do not instantiate the :class:`Server` class directly.
16191621
The sockets that represent existing incoming client connections
16201622
are left open.
16211623

1622-
The server is closed asynchronously, use the :meth:`wait_closed`
1623-
coroutine to wait until the server is closed.
1624+
The server is closed asynchronously; use the :meth:`wait_closed`
1625+
coroutine to wait until the server is closed (and no more
1626+
connections are active).
16241627

16251628
.. method:: get_loop()
16261629

@@ -1678,7 +1681,8 @@ Do not instantiate the :class:`Server` class directly.
16781681

16791682
.. coroutinemethod:: wait_closed()
16801683

1681-
Wait until the :meth:`close` method completes.
1684+
Wait until the :meth:`close` method completes and all active
1685+
connections have finished.
16821686

16831687
.. attribute:: sockets
16841688

@@ -1886,7 +1890,7 @@ Set signal handlers for SIGINT and SIGTERM
18861890

18871891
(This ``signals`` example only works on Unix.)
18881892

1889-
Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM`
1893+
Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal.SIGTERM`
18901894
using the :meth:`loop.add_signal_handler` method::
18911895

18921896
import asyncio

_sources/library/difflib.rst.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
171171
expressed in the ISO 8601 format. If not specified, the
172172
strings default to blanks.
173173

174+
>>> import sys
175+
>>> from difflib import *
174176
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
175177
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
176-
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py'))
178+
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py',
179+
... tofile='after.py'))
177180
*** before.py
178181
--- after.py
179182
***************
@@ -294,13 +297,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
294297
For inputs that do not have trailing newlines, set the *lineterm* argument to
295298
``""`` so that the output will be uniformly newline free.
296299

297-
The context diff format normally has a header for filenames and modification
300+
The unified diff format normally has a header for filenames and modification
298301
times. Any or all of these may be specified using strings for *fromfile*,
299302
*tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
300303
expressed in the ISO 8601 format. If not specified, the
301304
strings default to blanks.
302305

303-
304306
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
305307
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
306308
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py'))

_sources/library/fcntl.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. For a
1818
complete description of these calls, see :manpage:`fcntl(2)` and
1919
:manpage:`ioctl(2)` Unix manual pages.
2020

21-
.. include:: ../includes/wasm-notavail.rst
21+
.. availability:: Unix, not Emscripten, not WASI.
2222

2323
All functions in this module take a file descriptor *fd* as their first
2424
argument. This can be an integer file descriptor, such as returned by

_sources/library/grp.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This module provides access to the Unix group database. It is available on all
1111
Unix versions.
1212

13-
.. include:: ../includes/wasm-notavail.rst
13+
.. availability:: Unix, not Emscripten, not WASI.
1414

1515
Group database entries are reported as a tuple-like object, whose attributes
1616
correspond to the members of the ``group`` structure (Attribute field below, see

_sources/library/itertools.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ operator can be mapped across two vectors to form an efficient dot-product:
4141
================== ================= ================================================= =========================================
4242
Iterator Arguments Results Example
4343
================== ================= ================================================= =========================================
44-
:func:`count` start, [step] start, start+step, start+2*step, ... ``count(10) --> 10 11 12 13 14 ...``
44+
:func:`count` [start[, step]] start, start+step, start+2*step, ... ``count(10) --> 10 11 12 13 14 ...``
4545
:func:`cycle` p p0, p1, ... plast, p0, p1, ... ``cycle('ABCD') --> A B C D A B C D ...``
4646
:func:`repeat` elem [,n] elem, elem, elem, ... endlessly or up to n times ``repeat(10, 3) --> 10 10 10``
4747
================== ================= ================================================= =========================================

_sources/library/locale.rst.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The :mod:`locale` module defines the following exception and functions:
303303
*language code* and *encoding* may be ``None`` if their values cannot be
304304
determined.
305305

306-
.. deprecated-removed:: 3.11 3.13
306+
.. deprecated-removed:: 3.11 3.15
307307

308308

309309
.. function:: getlocale(category=LC_CTYPE)
@@ -464,11 +464,16 @@ The :mod:`locale` module defines the following exception and functions:
464464

465465
.. data:: LC_CTYPE
466466

467-
.. index:: pair: module; string
467+
Locale category for the character type functions. Most importantly, this
468+
category defines the text encoding, i.e. how bytes are interpreted as
469+
Unicode codepoints. See :pep:`538` and :pep:`540` for how this variable
470+
might be automatically coerced to ``C.UTF-8`` to avoid issues created by
471+
invalid settings in containers or incompatible settings passed over remote
472+
SSH connections.
468473

469-
Locale category for the character type functions. Depending on the settings of
470-
this category, the functions of module :mod:`string` dealing with case change
471-
their behaviour.
474+
Python doesn't internally use locale-dependent character transformation functions
475+
from ``ctype.h``. Instead, an internal ``pyctype.h`` provides locale-independent
476+
equivalents like :c:macro:`!Py_TOLOWER`.
472477

473478

474479
.. data:: LC_COLLATE

0 commit comments

Comments
 (0)