[pypy-issue] [issue989] Can't do ** on individual numpypy array element
mikefc
tracker at bugs.pypy.org
Sun Jan 8 05:25:55 CET 2012
New submission from mikefc <coolbutuseless at gmail.com>:
If a=numpy.array([1,2,3]) then a[1]**2 fails with a TypeError: operands do not
support **
After looking at objspace/descroperation.py I figured that a[1]**np.array(2) works
because the objects are of the same time. I'm trying to see if I can fix it
there, but don't hold your breath on my rpython expertise...
==================================
>>>> a = np.array([1,2,3])
>>>> a**2
array([1, 4, 9])
>>>> a[1]**2
Traceback (application-level):
File "<inline>", line 1 in <module>
a[1]**2
TypeError: operands do not support **
>>>> a[1]**np.array(2)
4
----------
messages: 3663
nosy: mikefc, pypy-issue
priority: bug
release: ???
status: unread
title: Can't do ** on individual numpypy array element
________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue989>
________________________________________
More information about the pypy-issue
mailing list