Skip to content
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

gh-100972: For command line examples in the documentation, use "python" rather than "python3 #100973

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

furkanonder
Copy link
Sponsor Contributor

@furkanonder furkanonder commented Jan 12, 2023

@furkanonder furkanonder requested a review from vsajip as a code owner Jan 12, 2023
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir skip news labels Jan 12, 2023
@furkanonder furkanonder changed the title gh-100972: Prefer "python" over "python3" gh-100972: For command line examples in the documentation, use "python" rather than "python3 Jan 12, 2023
hugovk
hugovk approved these changes Jan 12, 2023
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -73,7 +73,7 @@ something into it:

.. code-block:: shell-session

$ python3 -m venv example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave python3 here as it is an instruction how to create a virtual environment. I didn't change it on purpose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree since older systems may still have Python 2.7 set a python.

@@ -259,7 +259,7 @@ one mentioned below are preferred.

See :mod:`venv` for an example of a package with a minimal ``__main__.py``
in the standard library. It doesn't contain a ``if __name__ == '__main__'``
block. You can invoke it with ``python3 -m venv [directory]``.
block. You can invoke it with ``python -m venv [directory]``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave python3 here as it is an instruction how to create a virtual environment. I didn't change it on purpose.

@@ -44,7 +44,7 @@ whichever version you want.
To create a virtual environment, decide upon a directory where you want to
place it, and run the :mod:`venv` module as a script with the directory path::

python3 -m venv tutorial-env
python -m venv tutorial-env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave python3 here as it is an instruction how to create a virtual environment. I didn't change it on purpose.

@@ -222,7 +222,7 @@ Other Language Changes
(Contributed by Ngalim Siregar in :issue:`37444`.)

* Python now gets the absolute path of the script filename specified on
the command line (ex: ``python3 script.py``): the ``__file__`` attribute of
the command line (ex: ``python script.py``): the ``__file__`` attribute of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much value in changing old release notes.

@vsajip
Copy link
Member

vsajip commented Jan 12, 2023

Doesn't this assume that the system Python installation will be Python 3.x such that "python" will start a 3.x interpreter? If that's the case, it shouldn't be needed to specify "python3" for "-m venv" usages, right? Also, is it definitely the case that "python" will invoke 3.x on all platforms, old and new? For example I have some (not very) old Ubuntu machines where "python3" is needed. Anyone following along the documentation with this change could run into problems.

@rhettinger
Copy link
Contributor

On my Mac, python no longer refers to an executable. Only python3 works. So, at least for Mac Users, the status quo is better. With the proposed substitutions, the examples won't work any more.

@furkanonder
Copy link
Sponsor Contributor Author

On my Mac, python no longer refers to an executable. Only python3 works. So, at least for Mac Users, the status quo is better. With the proposed substitutions, the examples won't work any more.

If there are problems with the Mac, I think this PR should be reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants