Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #1475, supersedes #1476
Given the precedent in #1527 to stop bypassing the current warning filters for
@deprecated, this PR now expands this towarn_deprecated()as well.This, just like #1527, has the unfortunate consequence of
DeprecationWarnings no longer showing up for most people, unless they use-W default/-X dev/etc.see also https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries
There are a few possible solutions to this:
FutureWarning(linky)class DisnakeDeprecationWarning(DeprecationWarning)and adefault::DisnakeDeprecationWarningfilterwarnings.filters?default::DeprecationWarning:disnakefilter instead (without a custom subclass) would not work, as the module filtering is based on where the warning surfaces (i.e. whichever frame the stacklevel points to), not the module the original.warn()call location is inclass DisnakeDeprecationWarning(UserWarning)DeprecationWarningandFutureWarningall over.ignore::DeprecationWarningfilter in 3.10+, I guess?? /jChanging that would be a followup PR, and I'd very much love to find a solution before the next release, but I'm still sorta undecided on which way to go with this, so I would appreciate any ideas/feedback c:
Checklist
uv run nox -s lintuv run nox -s pyright