* gh-127604: Docs: Include a C stack in the `faulthandler` example (GH-136081)
(cherry picked from commit 3947847914)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Docs: Fix indentation in `slice` class of `functions.rst` (GH-134393)
Paragraph should not be under `slice.step`. It applies to the whole class.
(cherry picked from commit 6227662ff3)
Co-authored-by: Rob Reynolds <13379223+reynoldsnlp@users.noreply.github.com>
Adds a note about flush/close on copyfileobj, and updates
the Emscripten build script to follow documented advice.
(cherry picked from commit 34393cbdd4)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Docs: Use `arguments` to replace `args` in `argparse.rst` (GH-135510)
(cherry picked from commit caad163b69)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
gh-89083: add links to RFC 9562 sections in UUID docs (GH-135684)
We also sync the docs for UUIDv1 and UUIDv6 concerning the node address and clock sequence.
---------
(cherry picked from commit b881e3db1e)
Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Docs: Emphasize parameter name in `pkgutil.iter_importers` (GH-135597)
(cherry picked from commit ff639af8ee)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Most importantly, this resolves the issues with functions and types defined in __main__.
It also expands the number of supported objects and simplifies the implementation.
(cherry picked from commit 725da50520, AKA gh-133957)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Docs: Fix markups for emphasis (GH-135598)
The word emphasis character `_` is not supported as sphinx markup, so changed to `*`.
(cherry picked from commit 46c60e0d0b)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
---------
(cherry picked from commit f079979599)
Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (GH-92900)
* gh-67022: Document bytes/str inconsistency in email.header.decode_header()
This function's possible return types have been surprising and error-prone
for the entirety of its Python 3.x history. It can return either:
1. `typing.List[typing.Tuple[bytes, typing.Optional[str]]]` of length >1
2. or `typing.List[typing.Tuple[str, None]]`, of length exactly 1
This means that any user of this function must be prepared to accept either
`bytes` or `str` for the first member of the 2-tuples it returns, which is a
very surprising behavior in Python 3.x, particularly given that the second
member of the tuple is supposed to represent the charset/encoding of the
first member.
This patch documents the behavior of this function, and adds test cases
to demonstrate it.
As discussed in bpo-22833, this cannot be changed in a backwards-compatible
way, and some users of this function depend precisely on the existing
behavior.
Add warnings about obsolescence of 'email.header.decode_header' and 'email.header.make_header' functions.
Recommend use of `email.headerregistry.HeaderRegistry` instead, as suggested
in https://github.com/python/cpython/pull/92900#discussion_r1112472177
(cherry picked from commit 60181f4ed0)
Co-authored-by: Dan Lenski <dlenski@gmail.com>
gh-106318: Add example for `str.endswith()` (GH-134523)
(cherry picked from commit eed827ed09)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
PEP-734 has been accepted (for 3.14).
(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)
(cherry picked from commit 62143736b, AKA gh-133958)
Fix presentation of dataclasses' `unsafe_hash` default value (GH-116532)
(cherry picked from commit 71f5fafdfb)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-134976: document the exception type that can be raised by `s[i]` (GH-134977)
(cherry picked from commit 158e5162bf)
Co-authored-by: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com>
gh-135244: generate UUID random Node ID with a CSPRNG as per RFC 9562, §6.10.3 (GH-135226)
This aligns with the recommendations of RFC 9562, Section 6.10, paragraph 3 [1].
[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.10-3.
---------
(cherry picked from commit 1cb7163872)
Co-authored-by: LamentXU <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-134449: fix grammar for `precision_with_grouping` in format description (GH-134608)
This amends commit f39a07be47.
(cherry picked from commit 7828d52680)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Contrary to the current docs, ast.Constant will never hold containers
such as frozenset or tuple; the Python parser only emits it for simple
literals.
For precision, add the exact list of types that may be contained in an
ast.Constant.
(cherry picked from commit 381020d41f)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.
(cherry picked from commit b783e1791b)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Update outdated statement from `math` about C standard (GH-134621)
(cherry picked from commit 21672b694b)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Fix typing.TYPE_CHECKING docs to reflect PEP 649. (GH-134813)
typing.TYPE_CHECKING should no longer steer users towards
manual or automatic stringization (and PEP 563); PEP 649
makes all that unnecessary.
(cherry picked from commit d7256ae4d7)
Co-authored-by: larryhastings <larry@hastings.org>