diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-07-01 12:51:49 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-07-01 12:51:49 +0100 |
commit | 49e10732433c26d7c781e00a415fa33dada6ac90 (patch) | |
tree | 320f59d36c9d8b6fa30fc0c8766dfd48b10c02ca /numpy/lib/recfunctions.py | |
parent | 4bbbca2dda4099f689a8fb195696062ed783e4ce (diff) | |
download | numpy-49e10732433c26d7c781e00a415fa33dada6ac90.tar.gz |
MAINT: use set operators for brevity
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r-- | numpy/lib/recfunctions.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index b9542e848..08faeee0e 100644 --- a/numpy/lib/recfunctions.py +++ b/numpy/lib/recfunctions.py @@ -920,10 +920,10 @@ def join_by(key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2', (r1names, r2names) = (r1.dtype.names, r2.dtype.names) # Check the names for collision - if (set.intersection(set(r1names), set(r2names)).difference(key) and - not (r1postfix or r2postfix)): + collisions = (set(r1names) & set(r2names)) - set(key) + if collisions and not (r1postfix or r2postfix): msg = "r1 and r2 contain common names, r1postfix and r2postfix " - msg += "can't be empty" + msg += "can't both be empty" raise ValueError(msg) # Make temporary arrays of just the keys |