Skip to content

Refactor PyFile_GetLine: reduce duplicated condition logic#145796

Closed
tryuzr wants to merge 1 commit intopython:mainfrom
tryuzr:refactor/remove-duplicate-condition
Closed

Refactor PyFile_GetLine: reduce duplicated condition logic#145796
tryuzr wants to merge 1 commit intopython:mainfrom
tryuzr:refactor/remove-duplicate-condition

Conversation

@tryuzr
Copy link

@tryuzr tryuzr commented Mar 11, 2026

Consolidated repeated conditions n < 0 && result != NULL into a single check and handled the result type using PyBytes_Check and PyUnicode_Check inside the block.

This reduces duplication and improves code readability while keeping the original behavior unchanged.

Consolidated repeated conditions `n < 0 && result != NULL`
into a single check and handled the result type using
PyBytes_Check and PyUnicode_Check inside the block.

This reduces duplication and improves code readability
while keeping the original behavior unchanged.
@python-cla-bot
Copy link

python-cla-bot bot commented Mar 11, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 11, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@StanFromIreland
Copy link
Member

This is churn IMO.

@StanFromIreland StanFromIreland added pending The issue will be closed if no feedback is provided type-refactor Code refactoring (with no changes in behavior) labels Mar 11, 2026
@picnixz picnixz closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review pending The issue will be closed if no feedback is provided type-refactor Code refactoring (with no changes in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants