MCPcopy Create free account
hub / github.com/numpy/numpy / _PyLong_Bytes

Function _PyLong_Bytes

numpy/core/src/common/npy_longdouble.c:101–111  ·  view source on GitHub ↗

Helper function to get unicode(PyLong).encode('utf8') */

Source from the content-addressed store, hash-verified

99
100/* Helper function to get unicode(PyLong).encode('utf8') */
101static PyObject *
102_PyLong_Bytes(PyObject *long_obj) {
103 PyObject *bytes;
104 PyObject *unicode = PyObject_Str(long_obj);
105 if (unicode == NULL) {
106 return NULL;
107 }
108 bytes = PyUnicode_AsUTF8String(unicode);
109 Py_DECREF(unicode);
110 return bytes;
111}
112
113
114/**

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected