Skip to content

Changed if else statement code block to ternary operator #22423

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

Closed
wants to merge 2 commits into from
Closed

Changed if else statement code block to ternary operator #22423

wants to merge 2 commits into from

Conversation

AliyevH
Copy link
Contributor

@AliyevH AliyevH commented Sep 26, 2020

No description provided.

Changed if else statement code block to ternary operator
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@AliyevH

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@tirkarthi
Copy link
Member

Sorry, the existing code is clear enough. Though there are style disparities over using if-else in single line vs multiple lines changing it only for style reason only pollutes git history in my opinion.

@AliyevH
Copy link
Contributor Author

AliyevH commented Oct 16, 2020

Hi Karthikeyan. Thanks for reply.
Yes. you are right. It was first commit, that is why tried to see if i can get any response.
What about to change old syntax style to new new one? As you mentioned not in one place only, as it seems very ugly )), but in everywhere. If you are planning to do it, we would like to work on it

@methane
Copy link
Member

methane commented Oct 26, 2020

Sorry your first PR was a style change! you’re not the first one to have this idea, we know it comes from a good intention, but the CPython project doesn’t take these kind of aesthetic-only changes

  • modules have been contributed by multiple people over 30 years, so there isn’t one style
  • each change has a cost: reviewer time, compute time on the test machines, size of the repo and transfer, etc
  • a cosmetic change doesn’t really improve or fix anything (and has a small risk to break something)
  • cosmetic changes obscure history and make it harder to find who really changed what line when (devs spend a lot of time looking at history to understand changes in a module and track where bugs come from)

I hope this explains why your PR was not accepted, and that if you want to make a contribution you are welcome! Here’s the guide: https://devguide.python.org/

@methane methane closed this Oct 26, 2020
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.

5 participants