diff options
author | Josh Wilson <person142@users.noreply.github.com> | 2020-03-22 11:54:37 -0700 |
---|---|---|
committer | Josh Wilson <person142@users.noreply.github.com> | 2020-03-22 11:54:37 -0700 |
commit | 7ccadc342e8eb519873fa330fd57a97ebe6c575f (patch) | |
tree | c4900f1b63a706b04b6c4254efb552f562cf6218 /doc/source | |
parent | bcce3ac27e05ffd10584c3c8c666dade21714d1f (diff) | |
download | numpy-7ccadc342e8eb519873fa330fd57a97ebe6c575f.tar.gz |
DOC: correct possible list lengths for `extobj` in ufunc calls
According to the docs, the list can be of lengths 1, 2, or 3, but only
length 3 appears to work:
```
>>> import numpy as np
>>> np.sin(1, extobj=[16, 1, lambda: None])
0.8414709848078965
>>> np.sin(1, extobj=[16, 1])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: UFUNC_PYVALS must be a length 3 list.
>>> np.sin(1, extobj=[16])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: UFUNC_PYVALS must be a length 3 list.
```
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/ufuncs.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/source/reference/ufuncs.rst b/doc/source/reference/ufuncs.rst index 20c89e0b3..aad285122 100644 --- a/doc/source/reference/ufuncs.rst +++ b/doc/source/reference/ufuncs.rst @@ -441,13 +441,13 @@ advanced usage and will not typically be used. *extobj* - a list of length 1, 2, or 3 specifying the ufunc buffer-size, the - error mode integer, and the error call-back function. Normally, these + 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. + 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. |