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

Refactor double conditional into one #3118

Merged

Conversation

Rodrigo-Novas
Copy link
Contributor

Related to: #3117

@Rodrigo-Novas
Copy link
Contributor Author

I don't know if this small change warrants a changelog entry.

@pquentin pquentin added the Skip Changelog Pull requests that don't require a changelog entry label Sep 5, 2023
@pquentin
Copy link
Member

pquentin commented Sep 5, 2023

Well we could go one step further and write flush_decoder = amt is None or (amt != 0 and not data). I'll let someone else weigh in as I wrote this code initially and am not sure if any of this makes a big difference.

@Rodrigo-Novas
Copy link
Contributor Author

Well we could go one step further and write flush_decoder = amt is None or (amt != 0 and not data). I'll let someone else weigh in as I wrote this code initially and am not sure if any of this makes a big difference.

Yes good catch!. I think it is not a core change but having the code without elifs makes it more readable and without so much redundancy.

@pquentin
Copy link
Member

Closing given the lack of interest, sorry.

@pquentin pquentin closed this Sep 13, 2023
src/urllib3/response.py Outdated Show resolved Hide resolved
@pquentin pquentin reopened this Sep 14, 2023
@pquentin pquentin changed the title refactor: change double conditional to one Refactor double conditional into one Sep 15, 2023
@pquentin pquentin merged commit af7c78f into urllib3:main Sep 15, 2023
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants