MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / PyLong_AsByteArray

Function PyLong_AsByteArray

include/pyshim.hh:137–143  ·  view source on GitHub ↗

* @brief Shim for `_PyLong_AsByteArray`. * Python 3.13.0a4 added a new public API `PyLong_AsNativeBytes()` to replace the private `_PyLong_AsByteArray()`. * But this change also modified the function signature of `_PyLong_AsByteArray()`. * @see https://github.com/python/cpython/issues/111140 */

Source from the content-addressed store, hash-verified

135 * @see https://github.com/python/cpython/issues/111140
136 */
137inline int PyLong_AsByteArray(PyLongObject *v, unsigned char *bytes, size_t n, bool little_endian, bool is_signed) {
138#if PY_VERSION_HEX >= 0x030d0000 // Python version is 3.13 or higher
139 return _PyLong_AsByteArray(v, bytes, n, little_endian, is_signed, /*with_exceptions*/ false);
140#else
141 return _PyLong_AsByteArray(v, bytes, n, little_endian, is_signed);
142#endif
143}
144
145#endif // #ifndef PythonMonkey_py_version_shim_

Callers 1

toJsBigIntMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected