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
refactor: Report usage-based warnings as user-facing messages #464
Conversation
The other warnings are developer-facing and should indeed remain as DeprecationWarning.
So the rationale is that docs writers are not always developers and won't care about Python warnings? Or even have them disabled? I'm not sure they would care more about an INFO log... 🤔 |
|
Yet another way to look at it is: |
To me a deprecation warning is not exclusively used for functions. We deprecated using selection and rendering keys, so we inform the users with the standard deprecation mecanisms that they should stop using them, because they will disappear in the next versions and things will break. Users/devs who care about keeping up-to-date dependencies should enable warnings, as best-practice. If they don't and get caught by a breaking change later, that's on them 😕 Though I agree an additional log cannot hurt. |
Do you know any application that informs its users about removing features by emitting a Python DeprecationWarning (which, again, almost nobody will see)? |
Hmm but maybe we could consider just integrating this kind of warning instead https://docs.python.org/3/library/exceptions.html#UserWarning - it even seems to be enabled by default |
Well, it still talks about "user code" so still not a great fit |
https://docs.python.org/3/howto/logging.html#when-to-use-logging also confirms that the expected action in response to Warnings is to change the code of the application. Which doesn't match in these cases that I'm suggesting to change. And sorry that I sound so aggressive about this 😞 |
Thanks for the links, it seems the DeprecationWarning should not be used for that indeed. How do you feel about prefixing the log line with "DEPRECATION"? I worry users will simply miss/ignore them. |
OK! Why not. Here's how it will look (first warning is unrelated but nice to see in surrounding)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The other warnings are developer-facing and should indeed remain as DeprecationWarning.