Skip to content

feat: Implement better get_or_fetch #2776

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 102 commits into
base: master
Choose a base branch
from

Conversation

Lumabots
Copy link
Contributor

@Lumabots Lumabots commented May 3, 2025

Summary

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters). Implement better get_or_fetch #1856
  • 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.

@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

feat from #1856

@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

still not ready have some bug like : NameError: name 'VoiceChannel' is not defined
ig because of the type checking, i'll have to find a way to import it without circular import

@Paillat-dev
Copy link
Member

@Lumabots You can import it inside of the function where you use it directly instead of importing it at the top

@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

@Lumabots You can import it inside of the function where you use it directly instead of importing it at the top

Well ig the issue come from the definition for the typevar, so will that resolve it ?

@Lumabots
Copy link
Contributor Author

Lumabots commented May 4, 2025

should be ready for review

@Lumabots
Copy link
Contributor Author

Lumabots commented May 4, 2025

just need to specify that this is breaking inside the changelog cos of modification of get_or_fetch and removal of get_or_fetch_user

@Lumabots Lumabots requested a review from Soheab August 2, 2025 13:59
@Lulalaby
Copy link
Member

Lulalaby commented Aug 3, 2025

Merge conflicts again 😂

object_type: type[_FETCHABLE],
object_id: int | None,
default: _D = None,
) -> _FETCHABLE | _D | None:
Copy link
Member

Choose a reason for hiding this comment

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

These type vars don't have to and should not be imported from utils afaik, also no need to type self.

Also because some things can't be getorfetched from Client vs Guild so they should have their own _FETCHABLE that is bound to a subset of the base one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we talked about it with plun and he suggests me to import it from utils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-08-03 at 11 24 13

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about that. @plun1331 what's your reasoning ?

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.

6 participants