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

Fix while statements with non-bool conditions in _pyrepl #127509

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

Conversation

rruuaanng
Copy link
Contributor

@rruuaanng rruuaanng commented Dec 2, 2024

In Python, it is recommended to use bool values ​​as conditions, but there are still scenarios where integers are used in pyrepl, and we use while True instead of while 1.
(I hope this is not considered a cosmetic change. They were discovered when I was learning pyrepl.)

@rruuaanng
Copy link
Contributor Author

This change is minor, I don't think it's necessary to add a NEWS and title-label.

@skirpichev
Copy link
Member

I hope this is not considered a cosmetic change

I think it is.

@rruuaanng
Copy link
Contributor Author

I hope this is not considered a cosmetic change

I think it is.

But haven't we always advocated not using numbers as a condition?
Maybe this can be used as another solution.

@ZeroIntensity
Copy link
Member

We don't need a NEWS; users won't see or care about this change. With that being said, this is a cosmetic change. I'll let the repl experts decide if they want to take it.

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