summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-10-07 08:29:58 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2021-10-07 09:18:50 +0200
commite4d1c7781fcd762646c77449690491597c2be82f (patch)
tree64c6713873f4a213023cae4d76ea1a8b420a0ed9 /numpy
parent8d2ddb53a9dae2d90a752ad4995c30817049fe06 (diff)
downloadnumpy-e4d1c7781fcd762646c77449690491597c2be82f.tar.gz
DOC: Remove references to Python 2
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/ufunc_docstrings.py26
-rw-r--r--numpy/distutils/ccompiler.py3
-rw-r--r--numpy/lib/_iotools.py3
3 files changed, 3 insertions, 29 deletions
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py
index c15e1f042..14d4fd5ca 100644
--- a/numpy/core/code_generators/ufunc_docstrings.py
+++ b/numpy/core/code_generators/ufunc_docstrings.py
@@ -1091,9 +1091,8 @@ add_newdoc('numpy.core.umath', 'divide',
Behavior on division by zero can be changed using ``seterr``.
- In Python 2, when both ``x1`` and ``x2`` are of an integer type,
- ``divide`` will behave like ``floor_divide``. In Python 3, it behaves
- like ``true_divide``.
+ When both ``x1`` and ``x2`` are of an integer type, equivalent
+ to `numpy.true_divide`.
Examples
--------
@@ -1106,27 +1105,6 @@ add_newdoc('numpy.core.umath', 'divide',
[ Inf, 4. , 2.5],
[ Inf, 7. , 4. ]])
- Note the behavior with integer types (Python 2 only):
-
- >>> np.divide(2, 4)
- 0
- >>> np.divide(2, 4.)
- 0.5
-
- Division by zero always yields zero in integer arithmetic (again,
- Python 2 only), and does not raise an exception or a warning:
-
- >>> np.divide(np.array([0, 1], dtype=int), np.array([0, 0], dtype=int))
- array([0, 0])
-
- Division by zero can, however, be caught using ``seterr``:
-
- >>> old_err_state = np.seterr(divide='raise')
- >>> np.divide(1, 0)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- FloatingPointError: divide by zero encountered in divide
-
>>> ignored_states = np.seterr(**old_err_state)
>>> np.divide(1, 0)
0
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index 6d063ee4e..4495c8fee 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -258,9 +258,6 @@ def CCompiler_compile(self, sources, output_dir=None, macros=None,
If compilation fails.
"""
- # This method is effective only with Python >=2.3 distutils.
- # Any changes here should be applied also to fcompiler.compile
- # method to support pre Python 2.3 distutils.
global _job_semaphore
jobs = get_num_build_jobs()
diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py
index a576925d6..4a5ac1285 100644
--- a/numpy/lib/_iotools.py
+++ b/numpy/lib/_iotools.py
@@ -23,8 +23,7 @@ def _decode_line(line, encoding=None):
Returns
-------
- decoded_line : unicode
- Unicode in Python 2, a str (unicode) in Python 3.
+ decoded_line : str
"""
if type(line) is bytes: