8000 Add _PyLong_Sign · timfel/pyo3@e39334f · GitHub
[go: up one dir, main page]

Skip to content

Commit e39334f

Browse files
committed
Add _PyLong_Sign
ormsgpack currently interprets PyLongObjects' ob_size field. CPython also added this one back since they got feedback that there is no efficient public API alternative, yet: python/cpython#112026
1 parent 26c7b29 commit e39334f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

newsfragments/1.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `_PyLong_Sign`

pyo3-ffi/src/cpython/longobject.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub const Py_ASNATIVEBYTES_UNSIGNED_BUFFER: c_int = 4;
2626
pub const Py_ASNATIVEBYTES_REJECT_NEGATIVE: c_int = 8;
2727

2828
extern "C" {
29-
// skipped _PyLong_Sign
29+
#[cfg(not(PyPy))]
30+
pub fn _PyLong_Sign(v: *mut PyObject) -> c_int;
3031

3132
#[cfg(Py_3_13)]
3233
pub fn PyLong_AsNativeBytes(

0 commit comments

Comments
 (0)
0