summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-10-08 16:43:25 +0200
committerDimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>2022-10-08 16:47:00 +0200
commit4e36c1bebdfca23f491c874bb4d97d829e381836 (patch)
treebfc7866ab0f947d7cf362fe25f99833890b5a440
parent3cf2ca1611ecaf1d13c41075a7025b96e54e3ee3 (diff)
downloadnumpy-4e36c1bebdfca23f491c874bb4d97d829e381836.tar.gz
DOC: Remove documentation specific to Python 2
-rw-r--r--doc/source/reference/c-api/array.rst16
-rw-r--r--numpy/__init__.py7
-rw-r--r--numpy/core/_add_newdocs.py3
3 files changed, 12 insertions, 14 deletions
diff --git a/doc/source/reference/c-api/array.rst b/doc/source/reference/c-api/array.rst
index e4028b7b4..9e103ecb1 100644
--- a/doc/source/reference/c-api/array.rst
+++ b/doc/source/reference/c-api/array.rst
@@ -3047,14 +3047,14 @@ to.
structure with base, ptr, len, and flags members. The
:c:type:`PyArray_Chunk` structure is binary compatible with the
Python's buffer object (through its len member on 32-bit platforms
- and its ptr member on 64-bit platforms or in Python 2.5). On
- return, the base member is set to *obj* (or its base if *obj* is
- already a buffer object pointing to another object). If you need
- to hold on to the memory be sure to INCREF the base member. The
- chunk of memory is pointed to by *buf* ->ptr member and has length
- *buf* ->len. The flags member of *buf* is :c:data:`NPY_ARRAY_ALIGNED`
- with the :c:data:`NPY_ARRAY_WRITEABLE` flag set if *obj* has
- a writeable buffer interface.
+ and its ptr member on 64-bit platforms). On return, the base member
+ is set to *obj* (or its base if *obj* is already a buffer object
+ pointing to another object). If you need to hold on to the memory
+ be sure to INCREF the base member. The chunk of memory is pointed
+ to by *buf* ->ptr member and has length *buf* ->len. The flags
+ member of *buf* is :c:data:`NPY_ARRAY_ALIGNED` with the
+ :c:data:`NPY_ARRAY_WRITEABLE` flag set if *obj* has a writeable
+ buffer interface.
.. c:function:: int PyArray_AxisConverter(PyObject* obj, int* axis)
diff --git a/numpy/__init__.py b/numpy/__init__.py
index 66b8e3eca..3260046d6 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -200,10 +200,9 @@ else:
_msg = (
"`np.{n}` is a deprecated alias for `np.compat.{n}`. "
- "To silence this warning, use `np.compat.{n}` by itself. "
- "In the likely event your code does not need to work on Python 2 "
- "you can use the builtin `{n2}` for which `np.compat.{n}` is itself "
- "an alias. Doing this will not modify any behaviour and is safe. "
+ "To silence this warning, use `np.compat.{n}` by itself, or "
+ "the builtin `{n2}` for which `np.compat.{n}` is itself an "
+ "alias. Doing this will not modify any behaviour and is safe. "
"{extended_msg}\n"
"Deprecated in NumPy 1.20; for more details and guidance: "
"https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations")
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
index 0405bfbe0..4ff838b77 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -1354,8 +1354,7 @@ add_newdoc('numpy.core.multiarray', 'fromstring',
decimal numbers, an operation which is better spelt
``frombuffer(string, dtype, count)``. If `string` contains unicode
text, the binary mode of `fromstring` will first encode it into
- bytes using either utf-8 (python 3) or the default encoding
- (python 2), neither of which produce sane results.
+ bytes using utf-8, which will not produce sane results.
${ARRAY_FUNCTION_LIKE}