Deprecating ndarray.tostring()
![](https://secure.gravatar.com/avatar/209654202cde8ec709dee0a4d23c717d.jpg?s=120&d=mm&r=g)
March 30, 2020
7:09 a.m.
Hi all, Just a heads up that in https://github.com/numpy/numpy/pull/15867 I plan to deprecate ndarray.tostring(), which is just a confusing way to spell ndarray.tobytes(). This function has been documented as a compatibility alias since NumPy 1.9, but never emitted a warning upon use. Given array.array.tostring() has been warning as far back as Python 3.1, it seems like we should follow suit. In order to reduce the impact of such a deprecation, I’ve filed the necessary scipy PR: https://github.com/scipy/scipy/pull/11755. It’s unlikely we’ll remove this function entirely any time soon, but the act of deprecating it may cause a few failing CI runs in projects where warnings are turned into errors. Eric
1783
Age (days ago)
1784
Last active (days ago)
2 comments
3 participants
participants (3)
-
Charles R Harris
-
Eric Wieser
-
Ralf Gommers