Skip to content

Commit 2e49323

Browse files
[3.14] gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) (GH-143854)
(cherry picked from commit 421bd17) Co-authored-by: Muneeb Ullah <moneebullah25@gmail.com>
1 parent 601ccb7 commit 2e49323

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/c-api/long.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
453453
454454
Otherwise, returns the number of bytes required to store the value.
455455
If this is equal to or less than *n_bytes*, the entire value was copied.
456-
All *n_bytes* of the buffer are written: large buffers are padded with
457-
zeroes.
456+
All *n_bytes* of the buffer are written: remaining bytes filled by
457+
copies of the sign bit.
458458
459459
If the returned value is greater than *n_bytes*, the value was
460460
truncated: as many of the lowest bits of the value as could fit are written,

0 commit comments

Comments
 (0)