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

STY: Small readability increases #2781

Merged
merged 5 commits into from
Aug 5, 2024

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Aug 1, 2024

Also remove unused DEFAULT_ANNOTATION_FLAG.

Also remove unused DEFAULT_ANNOTATION_FLAG.
Also remove unused DEFAULT_ANNOTATION_FLAG.
@j-t-1
Copy link
Contributor Author

j-t-1 commented Aug 1, 2024

Python 3.8 added an = specifier to f-strings. This PR should work when Python 3.7 support is removed.

@stefan6419846
Copy link
Collaborator

I disagree with these changes and suggest closing it. Rationale:

  • Having boolean variables with the is_ prefix is fine and increases readability by making it clear that it is a boolean by just looking at the name.
  • Unnecessarily dropping support for Python 3.7 for the sake of removing 20 characters (22 characters if taking into account that the equivalent call without the new formatting requires an additional !r) does not feel right.

@stefan6419846 stefan6419846 added the needs-discussion The PR/issue needs more discussion before we can continue label Aug 1, 2024
Also renamed two local variables to increase readability of if statement.
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.11%. Comparing base (38f3925) to head (38f3554).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2781      +/-   ##
==========================================
- Coverage   95.12%   95.11%   -0.01%     
==========================================
  Files          51       51              
  Lines        8547     8545       -2     
  Branches     1705     1705              
==========================================
- Hits         8130     8128       -2     
  Misses        263      263              
  Partials      154      154              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Aug 2, 2024

Removed the = specifier to f-strings.

The name change makes
if not is_external and not is_internal:
quicker to parse
if not external and not internal:

@stefan6419846
Copy link
Collaborator

I do not really see the benefit you mention, thus I am going to keep this open for now.

@pubpub-zz
Copy link
Collaborator

agree with @stefan6419846

@stefan6419846 stefan6419846 merged commit 09f9b7e into py-pdf:main Aug 5, 2024
17 checks passed
@j-t-1 j-t-1 deleted the _non_markup_annotations branch August 6, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion The PR/issue needs more discussion before we can continue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants