Skip to content

refactor: Remove unused and duplicate imports #2787

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Lumabots
Copy link
Contributor

@Lumabots Lumabots commented May 22, 2025

Summary

the type checker where not able to find discord.utils because of the http leading to no suggestion for everyfunction of utils like discord.utils.get etc etc

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
Screenshot 2025-05-22 at 22 56 35 Screenshot 2025-05-22 at 22 56 50

@Lumabots Lumabots changed the title refractor: remove unused import + double import Refactor: Remove unused and duplicate imports May 22, 2025
Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

CI is failing

@Lumabots Lumabots requested a review from Paillat-dev May 22, 2025 20:05
@Lumabots Lumabots changed the title Refactor: Remove unused and duplicate imports refactor: Remove unused and duplicate imports May 22, 2025
@plun1331
Copy link
Member

This looks like an issue with your type checker, not pycord

@Lumabots
Copy link
Contributor Author

This looks like an issue with your type checker, not pycord

well its still strange to have the discord utils being imported 2 times, and if its fix both why not merge it ;)

@Lumabots
Copy link
Contributor Author

I'll do some more investigation, so it's not ready for the moment

@Lumabots
Copy link
Contributor Author

so i did lot of testing (using different version of pylance etc) and seems that removing the double import just fix this all the time

@Lumabots Lumabots requested a review from Paillat-dev May 23, 2025 09:36
Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

I still have no idea where the problem comes from but I don't see an issue with the changes made

@Dorukyum
Copy link
Member

from . import utils is in over 17 files. It makes no sense to only change it here. Besides, pyright has no issues locating the utility functions in my experience. I'd remove the unused import but keep the rest.

@Lumabots Lumabots marked this pull request as draft June 28, 2025 09:00
@Lumabots
Copy link
Contributor Author

i'll check all around the lib for all unused import to removed them later (prob around end july)

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

I'll have to look into this more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants