Reading the numpy documentation, I noticed that every numpy math function (like add, multiply, log etc.) has an extobj optional argument. The documentation of the ufunc kwargs says the following:
A list of length 3 specifying the ufunc buffer-size, the error mode integer, and the error call-back function. Normally, these values are looked up in a thread-specific dictionary. Passing them here circumvents that look up and uses the low-level specification provided for the error mode. This may be useful, for example, as an optimization for calculations requiring many ufunc calls on small arrays in a loop.
If I understand correctly, it is possible to preallocate a buffer, where the calculations would take place, making it unnecessary to allocate memory for internal calculations. I was browsing the internet to learn how to use this argument, but found nothing, not even in the official numpy documentation.
What is the proper way to use extobj? In what scenarios would this be useful?