Skip to content

gh-128720: Fix doc inacurracy about __main__.__file__ existence in the REPL #128721

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 1 commit into from
Jan 21, 2025

Conversation

wimglenn
Copy link
Contributor

@wimglenn wimglenn commented Jan 10, 2025

I opted to just remove the confusing conditional.

If the example needs a "check for REPL" conditional, I'd suggest checking sys.ps1, however I think that could be scope creep and the example script is better off without that condition at all.


📚 Documentation preview 📚: https://cpython-previews--128721.org.readthedocs.build/

Comment on lines -364 to -366
Note that in this case the ``__main__`` scope doesn't contain a ``__file__``
attribute as it's interactive.

Copy link
Member

Choose a reason for hiding this comment

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

We may want to keep this line, depending on the resolution of the issue. I agree with the changes above.

@pablogsal pablogsal merged commit a4760ef into python:main Jan 21, 2025
36 checks passed
@pablogsal
Copy link
Member

Thanks a lot for the contribution @wimglenn and @AA-Turner for the review!

@wimglenn wimglenn deleted the __main__.__file__ branch January 21, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants