diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-11-12 17:17:24 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 17:17:24 -0600 |
commit | 067264b20f8d2c043cf5b9cd3d1826384e558e79 (patch) | |
tree | 4714149704808160daa1ee9b2bdaa9cfab2672d8 /numpy/core/arrayprint.py | |
parent | e34f5bb4e3aad2bb35fb6d9e3a5c1bfc85eb97eb (diff) | |
parent | 9fa3a4e9802b32c985f6a1fc14dd315a2656ac38 (diff) | |
download | numpy-067264b20f8d2c043cf5b9cd3d1826384e558e79.tar.gz |
Merge pull request #12362 from shoyer/disable-array-function-by-default
MAINT: disable `__array_function__` dispatch unless environment variable set
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r-- | numpy/core/arrayprint.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index ccc1468c4..b578fab54 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -1547,10 +1547,12 @@ def array_str(a, max_line_width=None, precision=None, suppress_small=None): a, max_line_width, precision, suppress_small) +# needed if __array_function__ is disabled +_array2string_impl = getattr(array2string, '__wrapped__', array2string) _default_array_str = functools.partial(_array_str_implementation, - array2string=array2string.__wrapped__) + array2string=_array2string_impl) _default_array_repr = functools.partial(_array_repr_implementation, - array2string=array2string.__wrapped__) + array2string=_array2string_impl) def set_string_function(f, repr=True): |