]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840)
authorMuneeb Ullah <moneebullah25@gmail.com>
Thu, 15 Jan 2026 08:22:01 +0000 (13:22 +0500)
committerGitHub <noreply@github.com>
Thu, 15 Jan 2026 08:22:01 +0000 (09:22 +0100)
Doc/c-api/long.rst

index 6834c872c8cfcdb0dc1ad4dbe2e8f43f50894a7c..ed9b37dc1721f28d20920571d8aca90741de329f 100644 (file)
@@ -453,8 +453,8 @@ distinguished from a number.  Use :c:func:`PyErr_Occurred` to disambiguate.
 
    Otherwise, returns the number of bytes required to store the value.
    If this is equal to or less than *n_bytes*, the entire value was copied.
-   All *n_bytes* of the buffer are written: large buffers are padded with
-   zeroes.
+   All *n_bytes* of the buffer are written: remaining bytes filled by
+   copies of the sign bit.
 
    If the returned value is greater than *n_bytes*, the value was
    truncated: as many of the lowest bits of the value as could fit are written,