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

Use removeprefix and removesuffix string methods #2911

Conversation

johannaengland
Copy link
Contributor

@johannaengland johannaengland commented May 14, 2024

These methods have been added to Python 3.9: https://peps.python.org/pep-0616/

They remove the prefix/suffix if it exists and do nothing to the string if not.

Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.35%. Comparing base (0a90566) to head (a917a22).
Report is 389 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2911      +/-   ##
==========================================
- Coverage   56.35%   56.35%   -0.01%     
==========================================
  Files         603      603              
  Lines       43862    43850      -12     
  Branches       48       48              
==========================================
- Hits        24719    24712       -7     
+ Misses      19131    19126       -5     
  Partials       12       12              

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

Copy link

Test results

       9 files         9 suites   7m 46s ⏱️
3 320 tests 3 320 ✔️ 0 💤 0
6 379 runs  6 379 ✔️ 0 💤 0

Results for commit 93088aa.

@johannaengland johannaengland force-pushed the use-remove-prefix-and-suffix-methods branch from 93088aa to bba6ffc Compare July 3, 2024 13:33
These were added in Python 3.9
@johannaengland johannaengland force-pushed the use-remove-prefix-and-suffix-methods branch from bba6ffc to a917a22 Compare August 7, 2024 16:27
Copy link
Contributor

@stveit stveit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can see the logic should be unchanged from this 👍

@johannaengland johannaengland merged commit d0a1cd7 into Uninett:master Aug 8, 2024
11 of 12 checks passed
@johannaengland johannaengland deleted the use-remove-prefix-and-suffix-methods branch August 8, 2024 15:52
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.

2 participants