From 18eb65228d0e3eca03796e9c30744974e53e2997 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 18 Aug 2019 21:03:44 -0500 Subject: MAINT: Remove incorrect comment about flattening Also adjust the code to more clearly indicate what actually happens. The behavior is identical before and after this patch. --- numpy/lib/recfunctions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/recfunctions.py') diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index fb0ae5cc3..a5d464e32 100644 --- a/numpy/lib/recfunctions.py +++ b/numpy/lib/recfunctions.py @@ -209,8 +209,8 @@ def zip_dtype(seqarrays, flatten=False): else: for a in seqarrays: current = a.dtype - if current.names and len(current.names) <= 1: - # special case - dtypes of 0 or 1 field are flattened + if current.names is not None and len(current.names) == 1: + # special case - dtypes of 1 field are flattened newdtype.extend(get_fieldspec(current)) else: newdtype.append(('', current)) -- cgit v1.2.1