-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Remove (Deprecate??) TrioDeprecationWarning #2992
Comments
I was concerned for a bit but backwards compaibility is trivial for this. The only times So we just, for every new deprecation, start raising |
We could just do the equivalent of import warnings
# this is in src/trio/_deprecate
MyTrioDeprecationWarning = DeprecationWarning
# and this is what people are currently doing, suppressing TrioDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=MyTrioDeprecationWarning)
# It still silences DeprecationWarning
warnings.warn(DeprecationWarning("hello")) And the only warning suppression that would break is if people are filtering on
We should maybe ask in gitter & search repos on github. The current deprecationwarnings, other than |
I partly resolved this in #2989, by adding a |
I think current deprecations are fine. They'll be gone in a couple years. |
I was thinking about whether to use
DeprecationWarning
orTrioDeprecationWarning
in #2989, when I decided to actually figure out what the difference is and whyTrioDeprecationWarning
is a thing. It lines up with https://bugs.python.org/issue24294, which was resolved with https://peps.python.org/pep-0565/ and released in python3.7Since we don't support 3.6 and earlier, the original reason for its existence is gone, so we at the very least should make it inherit from
DeprecationWarning
instead ofFutureWarning
and update the docstring. Or we go even further and removeTrioDeprecationWarning
entirely (with an intermediate period of making it a pure alias ofDeprecationWarning
but emitting aDeprecationWarning
).Having helper methods linking to issues and stuff is still helpful though, and after recent discussions in Gitter we maybe also want a parameter for how long we're planning to keep the deprecated thing around before it gets removed.
The text was updated successfully, but these errors were encountered: