Deprecating ndarray.tostring()

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Deprecating ndarray.tostring()

Eric Wieser

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


_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Deprecating ndarray.tostring()

ralfgommers


On Mon, Mar 30, 2020 at 1:09 PM Eric Wieser <[hidden email]> wrote:

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.


+1 agree with the deprecation, and with making it a long one given the handful of uses in Matplotlib and several handfuls in SciPy.

Cheers,
Ralf


_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Deprecating ndarray.tostring()

Charles R Harris


On Tue, Mar 31, 2020 at 5:33 AM Ralf Gommers <[hidden email]> wrote:


On Mon, Mar 30, 2020 at 1:09 PM Eric Wieser <[hidden email]> wrote:

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.


+1 agree with the deprecation, and with making it a long one given the handful of uses in Matplotlib and several handfuls in SciPy.


+1 also.

Chuck 

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion