pycord icon indicating copy to clipboard operation
pycord copied to clipboard

refactor: Remove unused and duplicate imports

Open Lumabots opened this issue 7 months ago • 5 comments

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

  • [x] 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).
  • [x] This PR is not a code change (e.g. documentation, README, typehinting, examples, ...).

Checklist

  • [x] I have searched the open pull requests for duplicates.
  • [ ] If code changes were made then they have been tested.
    • [x] I have updated the documentation to reflect the changes.
  • [x] If type: ignore comments were used, a comment is also left explaining why.
  • [x] 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 avatar May 22 '25 19:05 Lumabots

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

plun1331 avatar May 22 '25 20:05 plun1331

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 avatar May 22 '25 20:05 Lumabots

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

Lumabots avatar May 23 '25 06:05 Lumabots

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 avatar May 23 '25 09:05 Lumabots

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.

Dorukyum avatar May 25 '25 08:05 Dorukyum

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

Lumabots avatar Jun 28 '25 09:06 Lumabots

i'll close this as everything will be remake in next, its a too big change for a minor version

Lumabots avatar Oct 16 '25 05:10 Lumabots