diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-09-23 09:42:22 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-09-23 09:42:22 -0700 |
commit | 149c8e892e51251e9e3bbc8585f6b887db72f2e9 (patch) | |
tree | d7ea3b1bc76ee130af4265ec06aca5b1d6c3df64 /numpy/core/memmap.py | |
parent | 195881ed6e50085ca8b195c96367748ff3563c53 (diff) | |
download | numpy-149c8e892e51251e9e3bbc8585f6b887db72f2e9.tar.gz |
MAINT: Use a conditional expression instead of boolean operators
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r-- | numpy/core/memmap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index 3cf101e43..8269f537f 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -219,9 +219,9 @@ class memmap(ndarray): if hasattr(filename, 'read'): f_ctx = contextlib_nullcontext(filename) elif is_pathlib_path(filename): - f_ctx = filename.open((mode == 'c' and 'r' or mode)+'b') + f_ctx = filename.open(('r' if mode == 'c' else mode)+'b') else: - f_ctx = open(filename, (mode == 'c' and 'r' or mode)+'b') + f_ctx = open(filename, ('r' if mode == 'c' else mode)+'b') with f_ctx as fid: fid.seek(0, 2) |