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

Function intern_strings

numpy/core/src/umath/umathmodule.c:227–247  ·  view source on GitHub ↗

intern some strings used in ufuncs, returns 0 on success */

Source from the content-addressed store, hash-verified

225
226/* intern some strings used in ufuncs, returns 0 on success */
227static int
228intern_strings(void)
229{
230 npy_um_str_array_ufunc = PyUnicode_InternFromString("__array_ufunc__");
231 if (npy_um_str_array_ufunc == NULL) {
232 return -1;
233 }
234 npy_um_str_array_prepare = PyUnicode_InternFromString("__array_prepare__");
235 if (npy_um_str_array_prepare == NULL) {
236 return -1;
237 }
238 npy_um_str_array_wrap = PyUnicode_InternFromString("__array_wrap__");
239 if (npy_um_str_array_wrap == NULL) {
240 return -1;
241 }
242 npy_um_str_pyvals_name = PyUnicode_InternFromString(UFUNC_PYVALS_NAME);
243 if (npy_um_str_pyvals_name == NULL) {
244 return -1;
245 }
246 return 0;
247}
248
249/* Setup the umath part of the module */
250

Callers 1

initumathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected