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/lib/arraysetops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/arraysetops.py') diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index aa3a05e12..ededb9dd0 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -451,11 +451,11 @@ def in1d(ar1, ar2, assume_unique=False, invert=False): # This code is significantly faster when the condition is satisfied. if len(ar2) < 10 * len(ar1) ** 0.145: if invert: - mask = np.ones(len(ar1), dtype=np.bool) + mask = np.ones(len(ar1), dtype=bool) for a in ar2: mask &= (ar1 != a) else: - mask = np.zeros(len(ar1), dtype=np.bool) + mask = np.zeros(len(ar1), dtype=bool) for a in ar2: mask |= (ar1 == a) return mask -- cgit v1.2.1