The current re.VERBOSE documentation example leaves space for ambiguous
interpretation. One may read that spaces within the `(?:` token are
spaces inside the non-capturing group (such as `(?: )`). This patch
removes the ambiguity by including examples after the statement.
(cherry picked from commit 0ceafa7fa4)
Co-authored-by: Athos Ribeiro <athoscribeiro@gmail.com>
* Add/refine cross references to items in other lang changes section
* Unify context manager exception changes into single non-repetitive item
* More clearly describe the intent and consequences of the -P option
* Apply minor clarifications & copyedits to rest of section
* Tweak the formatting of module references
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit a77d9dedcd)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Move Windows py.exe improvements from Typing section to New Features
* Add ref target label and use literal for py.exe
* Be clearer/explict about what legacy version arg components reprisent
* Apply other minor clarity and textual fixes to py.exe launcher text
* Refine phrasing of legacy sentence of py.exe desc
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 985958187d)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
gh-88355: Fix backslashes in AF_PIPE (GH-96543)
Fix backslashes in AF_PIPE (GH-88355)
The correct syntax for AF_PIPE addresses is `\\.\pipe\blahblah`, not `\.\pipe{blahblah}`, but the syntax markup messed up the backslashes.
(cherry picked from commit ff28d8926d)
Co-authored-by: cousteau <cousteaulecommandant@users.noreply.github.com>
Co-authored-by: cousteau <cousteaulecommandant@users.noreply.github.com>
gh-96448: fix documentation for _thread.lock.acquire (GH-96449)
* fix documentation for _thread.lock.acquire
* update formatting of _thread.lock.acquire() doc
(cherry picked from commit 7acb93f0d4)
Co-authored-by: Daniel Giger <danielg3432@gmail.com>
Co-authored-by: Daniel Giger <danielg3432@gmail.com>
I was perusing this file, and noticed that this part of the documentation is slightly out of date: the `struct` items in this TOML file currently contain `struct_abi_kind` members, which distinguish between the different types of ABI compatibility described in the comment.
I've updated the comment to reflect this.
(cherry picked from commit 6e53308829)
Co-authored-by: William Woodruff <william@yossarian.net>
Included newline separator in Mandelbrot set
Now the Mandelbrot set one-liner example on separates the lines with a '\n' character.
(cherry picked from commit 49802605f8)
Co-authored-by: matheusja <matheusjahnke@hotmail.com>
Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
(cherry picked from commit 3a49dbb98c)
Co-authored-by: hetmankp <728670+hetmankp@users.noreply.github.com>
* Link TOML & WSGI in New Modules section, refine text & add ref label
* Further reformat new modules & add PEP link to tomllib
(cherry picked from commit bd00112a99)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-97740: Fix bang in Sphinx C domain ref target syntax
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Add NEWS entry for C domain bang fix
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 9148c0d893)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Don't parse content as arg in the impl-detail directive
This does not change the (untranslated) output,
but ensures that the doctree node metadata is correct.
which fixes gh-97607 with the text not being translated.
It also simplifies the code and logic
and makes it consistant with the docutils built-in directives.
* Remove unused branch from impl-detail directive handling no-content case
This is not used anywhere in the docs and lacks a clear use case,
and is more likely a mistake which is now flagged at build time.
This simplifies the logic from two code paths to one,
and makes the behavior consistant with similar built-in directives
(e.g. the various admonition types).
* Further simplify impl-detail reST directive code
(cherry picked from commit e8165d47b8)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-95975: Move except/*/finally ref labels to more precise locations
* Add section headers to fix :keyword: role and aid navigation
* Move see also to the introduction rather than a particular subsection
* Fix other minor Sphinx syntax issues with except
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Suppress redundant link to same section for except too
* Don't link try/except/else/finally keywords if in the same section
* Format try/except/finally as keywords in modified sections
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit dcc82331c8)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
It was never really safe and this claim conflicts directly with the big warning in the docs about it being able to crash the interpreter.
(cherry picked from commit 8baef8ae36)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
* When chaining futures, skip callback if loop closed.
* When shutting down an executor, don't wake a closed loop.
(cherry picked from commit e9d63760fe)
Co-authored-by: Guido van Rossum <guido@python.org>
Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
(cherry picked from commit 63780f4599)
Co-authored-by: Guido van Rossum <guido@python.org>
This documents the behavior that has always been the case since timeout
support was introduced in Python 3.3.
(cherry picked from commit b05dd79649)
Co-authored-by: Gregory P. Smith <greg@krypto.org>