[MRG] Replace DeprecationWarning with FutureWarning #15080
I'm wondering why we do
The unless triggered by code in
On the other hand, we have:
I'm in favor of using
Packages who depend on
Also, we wan move a bunch of our
I agree our DeprecationWarnings should probably have been FutureWarnings in the first place. I'm OK for switching to FutureWarnings.
However I don't think we want to worry about PendingFutureWarnings (at least for now, and definitely not for this PR, let's keep things simple).
Same for DeprecationWarning: these are for Python developers, not for library users/maintainers. I don't think we should ever mess with those.
The options are:
Is the "deprecated in 0.22" actionable information? I am going under the assumption that "no one reads warnings", so making the warning only include actionable information is a little nicer. "Remove in 0.24" -> better do something about this before 0.24.
I noticed PEP 565 says:
In the same section Additional use case for FutureWarning in the PEP 565 it states:
In the end I think we want the warning to be shown by default to users in the following situation:
# my_module.py import warnings def hello(): warnings.warn("Deprecated", DeprecationWarning)
# main.py from my_module import hello hello()