diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-11-16 23:22:17 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-11-17 08:59:47 -0800 |
commit | bcec12b441ec5b775c833e419a9042c6d06eaf70 (patch) | |
tree | d1eeb70e3657b3e59d5e75dd4d2ef0cba37c1287 /numpy/add_newdocs.py | |
parent | 565e8ca9ab7009160f99e7925402057684642b09 (diff) | |
download | numpy-bcec12b441ec5b775c833e419a9042c6d06eaf70.tar.gz |
BUG: Allow `int` to be called on nested object arrays
Rather than assuming that any object array is self-referencing, we can just use PyEnter_RecursiveCall in:
* `__int__`
* `__float__`
* `__long__`
* `__hex__`
* `__oct__`
This works towards (but does _not_ fix) #9972, by not directly touching the `nb_*` slots ourselves.
Substantial code deduplication here. Error message is different, but perhaps also better:
```python
>>> int(np.array([None]))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' # now
TypeError: cannot convert to an int; scalar object is not a number #before
```
Diffstat (limited to 'numpy/add_newdocs.py')
0 files changed, 0 insertions, 0 deletions