-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Update copy.py #104570
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
Update copy.py #104570
Conversation
I think that some code was being repeated because of an if else condition. I tried to combine them into one. Would loved to know the thoughts of the community.
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
What we have done here is called https://en.wikipedia.org/wiki/Loop_unswitching It may cause a performance penalty. Have you done benchmarks? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hello! |
@arhadthedev, please don't add "skip issue" and "skip news" to PRs like this:
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
@rajucomp, thank you for the PR! I agree that the code looks slightly simpler and less repetitive this way. However, I'm going to reject this PR, for three reasons:
Thanks again for the PR, though, and for your interest in improving CPython! |
I think that some code was being repeated because of an if else condition. I tried to combine them into one. Would loved to know the thoughts of the community.