-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Off-by-one index error in __main__.py doc #112165
Comments
If you run the example as: python3 -m bandclass my-name Then So do we want this? student_name = sys.argv[1] if len(sys.argv) >= 2 else '' |
Yes, that should be the fix indeed. Can you pls make the fix/PR? I have no idea how to do it, new to github and this was first time ever reading official python docs. But you gotta start somewhere |
I'm making the PR, but if you want to learn to do it, start with https://devguide.python.org/. |
Change '[2]' to '[1]' to get second argument.
Change '[2]' to '[1]' to get second argument.
Change '[2]' to '[1]' to get second argument. (cherry picked from commit 8cd70ee) Co-authored-by: Terry Jan Reedy <[email protected]>
Change '[2]' to '[1]' to get second argument. (cherry picked from commit 8cd70ee) Co-authored-by: Terry Jan Reedy <[email protected]>
gh-112165: Fix typo in `__main__.py` (GH-112183) Change '[2]' to '[1]' to get second argument. (cherry picked from commit 8cd70ee) Co-authored-by: Terry Jan Reedy <[email protected]>
gh-112165: Fix typo in `__main__.py` (GH-112183) Change '[2]' to '[1]' to get second argument. (cherry picked from commit 8cd70ee) Co-authored-by: Terry Jan Reedy <[email protected]>
Change '[2]' to '[1]' to get second argument.
Change '[2]' to '[1]' to get second argument.
Very minor issue, the '2' here should be '3' on the RHS of the comparison (given we really want to return sys.argv[2] from the ternary).
https://docs.python.org/3.10/library/__main__.html
Linked PRs
__main__.py
#112183__main__.py
(GH-112183) #112184__main__.py
(GH-112183) #112185The text was updated successfully, but these errors were encountered: