summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/function_base.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 788807086..b8e017eab 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -56,24 +56,24 @@ def iterable(y):
Returns
-------
- b : {0, 1}
- Return 1 if the object has an iterator method or is a sequence,
- and 0 otherwise.
+ b : bool
+ Return ``True`` if the object has an iterator method or is a
+ sequence and ``False`` otherwise.
Examples
--------
>>> np.iterable([1, 2, 3])
- 1
+ True
>>> np.iterable(2)
- 0
+ False
"""
try:
iter(y)
- except:
- return 0
- return 1
+ except TypeError:
+ return False
+ return True
def _hist_optim_numbins_estimator(a, estimator):