Skip to content

Remove precisely the prefix instead of strip #40415

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tqa236
Copy link

@tqa236 tqa236 commented Jul 15, 2025

Hello,

I am a first time contributor, still navigating the sage huge codebase. Please let me know if I am not aware of something.

This PR resolves a few occurrences of the error B005 from ruff.

It looks pretty clear to me that that intent of the code is to remove precisely these prefixes rather than, for example, removing all the leading occurrences of the letters d, e, f, a, u, l, t. I think the example in the docs of ruff illustrates quite well the difference.

Tested with ruff check src/sage --select B005

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@fchapoton
Copy link
Contributor

Thanks. Looks like a good idea. Let's wait for the CI.

Copy link
Contributor

@fchapoton fchapoton left a comment

Choose a reason for hiding this comment

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

ok, good

@user202729
Copy link
Contributor

Maybe we want to enable this rule in the CI as well. (Though not in scope here.)

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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy