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

fix: avoid incorrect warning about broken localizations in cogs #1133

Merged
merged 7 commits into from
Dec 8, 2023

Conversation

shiftinv
Copy link
Member

Summary

Cogs copy all command objects at instantiation (for applying cog-wide parameters), which ends up calling Option.name_localizations.__eq__ further down the line; at that point, LocalizationValues haven't been linked yet, which results in warnings being thrown incorrectly.
This PR fixes the comparison to bypass the property that's responsible for the warning in this particular case.
(at this point, localization probably deserves a full refactor, but that's a topic for another day)

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • 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, ...)

@shiftinv shiftinv added this to the disnake v2.10 milestone Nov 15, 2023
@shiftinv shiftinv requested a review from EQUENOS November 15, 2023 20:17
@shiftinv shiftinv enabled auto-merge (squash) December 8, 2023 14:54
@shiftinv shiftinv disabled auto-merge December 8, 2023 14:55
@shiftinv shiftinv merged commit 7d14837 into master Dec 8, 2023
27 checks passed
@shiftinv shiftinv deleted the fix/localization-cog-copy branch December 8, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: needs review Issue/PR is awaiting reviews t: bugfix
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant