numpy  2.0.0
src/private/npy_import.h File Reference
#include <Python.h>

Go to the source code of this file.

Functions

static NPY_INLINE void npy_cache_import (const char *module, const char *attr, PyObject **cache)

Function Documentation

static NPY_INLINE void npy_cache_import ( const char *  module,
const char *  attr,
PyObject **  cache 
) [static]
! brief Fetch and cache Python function. <blockquote>
Import a Python function and cache it for use. The function checks if cache is NULL, and if not NULL imports the Python function specified by a module and a function, increments its reference count, and stores the result in a cache. Usually a cache will be a static variable and should be initialized to NULL. On error a cache will contain NULL on exit,
&#64;param module Absolute module name. &#64;param attr module attribute to cache. &#64;param cache Storage location for imported function. </blockquote>

Referenced by array_add(), and array_swapaxes().