[3.12] Resolve reference warnings in faq/library.rst (GH-108149) (#108182)

Resolve reference warnings in faq/library.rst (GH-108149)
(cherry picked from commit 6323bc33ff)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-08-20 14:09:18 -07:00 committed by GitHub
parent a6f15af866
commit f2cc00527e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -111,7 +111,7 @@ Is there an equivalent to C's onexit() in Python?
------------------------------------------------- -------------------------------------------------
The :mod:`atexit` module provides a register function that is similar to C's The :mod:`atexit` module provides a register function that is similar to C's
:c:func:`onexit`. :c:func:`!onexit`.
Why don't my signal handlers work? Why don't my signal handlers work?
@ -397,7 +397,7 @@ These aren't::
D[x] = D[x] + 1 D[x] = D[x] + 1
Operations that replace other objects may invoke those other objects' Operations that replace other objects may invoke those other objects'
:meth:`__del__` method when their reference count reaches zero, and that can :meth:`~object.__del__` method when their reference count reaches zero, and that can
affect things. This is especially true for the mass updates to dictionaries and affect things. This is especially true for the mass updates to dictionaries and
lists. When in doubt, use a mutex! lists. When in doubt, use a mutex!
@ -765,14 +765,17 @@ The :mod:`select` module is commonly used to help with asynchronous I/O on
sockets. sockets.
To prevent the TCP connect from blocking, you can set the socket to non-blocking To prevent the TCP connect from blocking, you can set the socket to non-blocking
mode. Then when you do the :meth:`socket.connect`, you will either connect immediately mode. Then when you do the :meth:`~socket.socket.connect`,
you will either connect immediately
(unlikely) or get an exception that contains the error number as ``.errno``. (unlikely) or get an exception that contains the error number as ``.errno``.
``errno.EINPROGRESS`` indicates that the connection is in progress, but hasn't ``errno.EINPROGRESS`` indicates that the connection is in progress, but hasn't
finished yet. Different OSes will return different values, so you're going to finished yet. Different OSes will return different values, so you're going to
have to check what's returned on your system. have to check what's returned on your system.
You can use the :meth:`socket.connect_ex` method to avoid creating an exception. It will You can use the :meth:`~socket.socket.connect_ex` method
just return the errno value. To poll, you can call :meth:`socket.connect_ex` again later to avoid creating an exception.
It will just return the errno value.
To poll, you can call :meth:`~socket.socket.connect_ex` again later
-- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this -- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this
socket to :meth:`select.select` to check if it's writable. socket to :meth:`select.select` to check if it's writable.

View file

@ -26,7 +26,6 @@ Doc/c-api/unicode.rst
Doc/extending/extending.rst Doc/extending/extending.rst
Doc/extending/newtypes.rst Doc/extending/newtypes.rst
Doc/faq/gui.rst Doc/faq/gui.rst
Doc/faq/library.rst
Doc/glossary.rst Doc/glossary.rst
Doc/howto/descriptor.rst Doc/howto/descriptor.rst
Doc/howto/enum.rst Doc/howto/enum.rst