-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: Remove references to Python 2/3 #28956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The entire >>> import numpy as np
>>> np.compat
Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
np.compat
File "/home/joren/.pyenv/versions/3.13.3/lib/python3.13/site-packages/numpy/__init__.py", line 399, in __getattr__
raise AttributeError(
...<3 lines>...
)
AttributeError: `np.compat` was removed in the NumPy 2.0 release. There's no replacement, as Python 2 is no longer supported. edit: I opened #28961 for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't know about the C-api docs, but apart from those and my suggestions, the changes make sense to me.
@@ -526,7 +526,7 @@ def save(file, arr, allow_pickle=True, fix_imports=np._NoValue): | ||
|
||
.. deprecated:: 2.1 | ||
This flag is ignored since NumPy 1.17 and was only needed to | ||
support loading some files in Python 2 written in Python 3. | ||
support loading in Python 2 some files written in Python 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why this needs to change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a native speaker, of course, but I find it much easier to understand this way.
@@ -2830,7 +2830,7 @@ def add_newdoc(place, name, doc): | ||
>>> # n is 7, k is 4, m is 3 | ||
|
||
The matmul function implements the semantics of the ``@`` operator | ||
introduced in Python 3.5 following :pep:`465`. | ||
defined in :pep:`465`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How important is the exact version of Python that introduced the @
operator, especially nowadays, in the context of the documentation of current versions of NumPy?
tutorial`__. Cython provides a way to write code that supports the buffer | ||
protocol with Python versions older than 2.6 because it has a | ||
protocol of Python versions older than 2.6 because it has a | ||
backward-compatible implementation utilizing the array interface | ||
described here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well get rid of this entire sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and rebased to fix conflict.
EDIT: I think the linter issues are unrelated.
59726b4
to
05476ac
Compare
Four trailing whitespace fixes needed. |
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
05476ac
to
5722abd
Compare
The linter errors are unrelated. I have rebased in an attempt to fix them. |
Thanks @DimitriPapadopoulos . |
I have removed references to Python 2 or Python 3 wherever I feel it doesn't help intelligibility any more.
By the way, shouldn't
info
be deprecated?numpy/numpy/compat/py3k.py
Lines 123 to 130 in e4f0cd3