New submission from mikefc <[email protected]>:

Under cpython/numpy, an inplace operation on an array uses the same memory.

Under numpypy, new memory is allocated for the result.

This seems to be the case for: += -= *= /=
#----------------------------------------------------------
# code code code code code
#----------------------------------------------------------
try:
    import numpy as np
except:
    import numpypy as np

a = np.array([1,2,3], dtype='f8')
start_address = a.__array_interface__['data'][0]
a *= 3
assert(a.__array_interface__['data'][0] == start_address)

----------
messages: 5933
nosy: mikefc, pypy-issue
priority: bug
status: unread
title: numpypy inplace operations

________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1539>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to