Discussion:
[Numpy-discussion] Deprecating `numpy.iterable`
Joseph Fox-Rabinovitz
2016-02-11 03:09:09 UTC
Permalink
I have created a PR to deprecate `np.iterable`
(https://github.com/numpy/numpy/pull/7202). It is a very old function,
introduced as a utility in 2005
(https://github.com/numpy/numpy/commit/052a7b2e3276a303be1083022fc24d43084d2e14),
and there is no good reason for it to be part of the public API. It is
used internally 10 times within numpy. I have repaced those usages
with a private function `np.lib.function_base._iterable` and added a
`DeprecationWarning` to the public function.

Is there anyone that objects to deprecating this function?

Regards,

-Joseph
Stephan Hoyer
2016-02-11 18:25:33 UTC
Permalink
We certainly can (and probably should) deprecate this, but we can't remove
it for a very long time.

np.iterable is used in a lot of third party code.

On Wed, Feb 10, 2016 at 7:09 PM, Joseph Fox-Rabinovitz <
Post by Joseph Fox-Rabinovitz
I have created a PR to deprecate `np.iterable`
(https://github.com/numpy/numpy/pull/7202). It is a very old function,
introduced as a utility in 2005
(
https://github.com/numpy/numpy/commit/052a7b2e3276a303be1083022fc24d43084d2e14
),
and there is no good reason for it to be part of the public API. It is
used internally 10 times within numpy. I have repaced those usages
with a private function `np.lib.function_base._iterable` and added a
`DeprecationWarning` to the public function.
Is there anyone that objects to deprecating this function?
Regards,
-Joseph
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
Nathaniel Smith
2016-02-11 19:12:18 UTC
Permalink
Oh wow, yeah, there are tons of uses:
https://github.com/search?q=%22np.iterable%22&ref=simplesearch&type=Code&utf8=%E2%9C%93

Meh, I dunno, maybe we're stuck with it. It's not a major maintenance
burden at least.

-n
Post by Stephan Hoyer
We certainly can (and probably should) deprecate this, but we can't remove
it for a very long time.
np.iterable is used in a lot of third party code.
On Wed, Feb 10, 2016 at 7:09 PM, Joseph Fox-Rabinovitz
Post by Joseph Fox-Rabinovitz
I have created a PR to deprecate `np.iterable`
(https://github.com/numpy/numpy/pull/7202). It is a very old function,
introduced as a utility in 2005
(https://github.com/numpy/numpy/commit/052a7b2e3276a303be1083022fc24d43084d2e14),
and there is no good reason for it to be part of the public API. It is
used internally 10 times within numpy. I have repaced those usages
with a private function `np.lib.function_base._iterable` and added a
`DeprecationWarning` to the public function.
Is there anyone that objects to deprecating this function?
Regards,
-Joseph
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
--
Nathaniel J. Smith -- https://vorpus.org
Benjamin Root
2016-02-11 19:54:00 UTC
Permalink
Huh... matplotlib could use that! We have been using our own internal
function left over from the numerix days, I think.

Ben Root
Post by Nathaniel Smith
https://github.com/search?q=%22np.iterable%22&ref=simplesearch&type=Code&utf8=%E2%9C%93
Meh, I dunno, maybe we're stuck with it. It's not a major maintenance
burden at least.
-n
Post by Stephan Hoyer
We certainly can (and probably should) deprecate this, but we can't
remove
Post by Stephan Hoyer
it for a very long time.
np.iterable is used in a lot of third party code.
On Wed, Feb 10, 2016 at 7:09 PM, Joseph Fox-Rabinovitz
Post by Joseph Fox-Rabinovitz
I have created a PR to deprecate `np.iterable`
(https://github.com/numpy/numpy/pull/7202). It is a very old function,
introduced as a utility in 2005
(
https://github.com/numpy/numpy/commit/052a7b2e3276a303be1083022fc24d43084d2e14
),
Post by Stephan Hoyer
Post by Joseph Fox-Rabinovitz
and there is no good reason for it to be part of the public API. It is
used internally 10 times within numpy. I have repaced those usages
with a private function `np.lib.function_base._iterable` and added a
`DeprecationWarning` to the public function.
Is there anyone that objects to deprecating this function?
Regards,
-Joseph
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
--
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
Joseph Fox-Rabinovitz
2016-02-11 19:57:34 UTC
Permalink
It appears that deprecating `numpy.iterable` would be
counterproductive. I have reverted my PR to just making the return
value an actual `bool` instead of an `int`.
Post by Benjamin Root
Huh... matplotlib could use that! We have been using our own internal
function left over from the numerix days, I think.
Ben Root
Post by Nathaniel Smith
https://github.com/search?q=%22np.iterable%22&ref=simplesearch&type=Code&utf8=%E2%9C%93
Meh, I dunno, maybe we're stuck with it. It's not a major maintenance
burden at least.
-n
Post by Stephan Hoyer
We certainly can (and probably should) deprecate this, but we can't remove
it for a very long time.
np.iterable is used in a lot of third party code.
On Wed, Feb 10, 2016 at 7:09 PM, Joseph Fox-Rabinovitz
Post by Joseph Fox-Rabinovitz
I have created a PR to deprecate `np.iterable`
(https://github.com/numpy/numpy/pull/7202). It is a very old function,
introduced as a utility in 2005
(https://github.com/numpy/numpy/commit/052a7b2e3276a303be1083022fc24d43084d2e14),
and there is no good reason for it to be part of the public API. It is
used internally 10 times within numpy. I have repaced those usages
with a private function `np.lib.function_base._iterable` and added a
`DeprecationWarning` to the public function.
Is there anyone that objects to deprecating this function?
Regards,
-Joseph
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
--
Nathaniel J. Smith -- https://vorpus.org
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
https://mail.scipy.org/mailman/listinfo/numpy-discussion
Loading...