diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-06-30 12:11:08 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-06-30 12:41:42 -0700 |
commit | d47451764b2189b24105b7e86c2b098103e75cf0 (patch) | |
tree | 3add116d5aa5f8ac40b3250b8ab593c0eb4e3797 /numpy/core/multiarray.py | |
parent | f07a38da97a6a36eb12b203f6c1ffa4bf2b2cb87 (diff) | |
download | numpy-d47451764b2189b24105b7e86c2b098103e75cf0.tar.gz |
BUG: Remove items from `multiarray.__all__` which do not exist on python 3
Avoid using `_add_newdocs` if these functions do not exist.
Leaving the version-checking here so that we can backport to 1.16
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r-- | numpy/core/multiarray.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py index df0ed2df4..663f4c04a 100644 --- a/numpy/core/multiarray.py +++ b/numpy/core/multiarray.py @@ -7,6 +7,7 @@ by importing from the extension module. """ import functools +import sys import warnings from . import overrides @@ -30,15 +31,17 @@ __all__ = [ 'count_nonzero', 'c_einsum', 'datetime_as_string', 'datetime_data', 'digitize', 'dot', 'dragon4_positional', 'dragon4_scientific', 'dtype', 'empty', 'empty_like', 'error', 'flagsobj', 'flatiter', 'format_longfloat', - 'frombuffer', 'fromfile', 'fromiter', 'fromstring', 'getbuffer', 'inner', + 'frombuffer', 'fromfile', 'fromiter', 'fromstring', 'inner', 'int_asbuffer', 'interp', 'interp_complex', 'is_busday', 'lexsort', 'matmul', 'may_share_memory', 'min_scalar_type', 'ndarray', 'nditer', - 'nested_iters', 'newbuffer', 'normalize_axis_index', 'packbits', + 'nested_iters', 'normalize_axis_index', 'packbits', 'promote_types', 'putmask', 'ravel_multi_index', 'result_type', 'scalar', 'set_datetimeparse_function', 'set_legacy_print_mode', 'set_numeric_ops', 'set_string_function', 'set_typeDict', 'shares_memory', 'test_interrupt', 'tracemalloc_domain', 'typeinfo', 'unpackbits', 'unravel_index', 'vdot', 'where', 'zeros'] +if sys.version_info.major < 3: + __all__ += ['newbuffer', 'getbuffer'] arange.__module__ = 'numpy' |