Skip to content

Refactor double conditional into one#3118

Merged
pquentin merged 5 commits into
urllib3:mainfrom
Rodrigo-Novas:feature/fix-redundant-conditional
Sep 15, 2023
Merged

Refactor double conditional into one#3118
pquentin merged 5 commits into
urllib3:mainfrom
Rodrigo-Novas:feature/fix-redundant-conditional

Conversation

@Rodrigo-Novas

Copy link
Copy Markdown
Contributor

Related to: #3117

@Rodrigo-Novas

Copy link
Copy Markdown
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

pquentin commented Sep 5, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

Closing given the lack of interest, sorry.

@pquentin pquentin closed this Sep 13, 2023
Comment thread src/urllib3/response.py Outdated
@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
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.

3 participants