From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:34:13 +0000 (+0100) Subject: [3.14] gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e493239b14ee27646f30b818c987677ceb7551d;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) (GH-143854) (cherry picked from commit 421bd1770a87d141f66754ae29e407589e44ce83) Co-authored-by: Muneeb Ullah --- diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index eecb1b3b02cc..acc3f9668fdb 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -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,