Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
merged 2 commits into from
May 15, 2025
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

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

Parameters
----------
name : str
Full module name.
fn : str
Path to module file.
info : tuple, optional
Only here for backward compatibility with Python 2.*.

@jorenham
Copy link
Member

jorenham commented May 14, 2025

By the way, shouldn't info be deprecated?

The entire compat package seems rudimentary to me:

>>> 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

Copy link
Member

@jorenham jorenham left a 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.
Copy link
Member

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

Copy link
Contributor Author

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`.
Copy link
Member

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

Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos May 14, 2025

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?

Comment on lines 18 to 21
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.
Copy link
Member

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

Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos May 14, 2025

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.

@charris
Copy link
Member

charris commented May 14, 2025

Four trailing whitespace fixes needed.

DimitriPapadopoulos and others added 2 commits May 15, 2025 09:35
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@DimitriPapadopoulos
Copy link
Contributor Author

The linter errors are unrelated. I have rebased in an attempt to fix them.

@charris charris merged commit d936ca0 into numpy:main May 15, 2025
74 checks passed
@charris
Copy link
Member

charris commented May 15, 2025

Thanks @DimitriPapadopoulos .

@DimitriPapadopoulos DimitriPapadopoulos deleted the Python_X branch May 15, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.