From 2b781f8967488dc007f8f0a1e6a7f49208788d12 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Tue, 1 Aug 2017 20:29:36 +0000 Subject: MAINT/DOC: Use builtin when np.{x} is builtins.{x}. This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful --- numpy/core/numeric.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 02f9be3a9..13a99505c 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -133,7 +133,7 @@ def zeros_like(a, dtype=None, order='K', subok=True): array([[0, 0, 0], [0, 0, 0]]) - >>> y = np.arange(3, dtype=np.float) + >>> y = np.arange(3, dtype=float) >>> y array([ 0., 1., 2.]) >>> np.zeros_like(y) @@ -176,7 +176,7 @@ def ones(shape, dtype=None, order='C'): >>> np.ones(5) array([ 1., 1., 1., 1., 1.]) - >>> np.ones((5,), dtype=np.int) + >>> np.ones((5,), dtype=int) array([1, 1, 1, 1, 1]) >>> np.ones((2, 1)) @@ -243,7 +243,7 @@ def ones_like(a, dtype=None, order='K', subok=True): array([[1, 1, 1], [1, 1, 1]]) - >>> y = np.arange(3, dtype=np.float) + >>> y = np.arange(3, dtype=float) >>> y array([ 0., 1., 2.]) >>> np.ones_like(y) @@ -344,7 +344,7 @@ def full_like(a, fill_value, dtype=None, order='K', subok=True): Examples -------- - >>> x = np.arange(6, dtype=np.int) + >>> x = np.arange(6, dtype=int) >>> np.full_like(x, 1) array([1, 1, 1, 1, 1, 1]) >>> np.full_like(x, 0.1) -- cgit v1.2.1