On Saturday 21 January 2017 22:55:51 Tim Graham wrote: > > I'm advocating to remove the undocumented things in Django 3.0 (released > Dec. 2019) or later without a deprecation. By that time, I hope third-party > apps won't support Python 2 either and so part of adding Django 3.0 > compatibility will include formally dropping support for Python 2 (if not > done already) and removing usage of this stuff (a fairly easy find/replace, > hopefully). > > Others have advocated to deprecate all these things, but I don't see much > advantage. If I were maintaining an app, I'd rather be able to use import > shims without warnings until Python 2 is gone. What's your preference? >
I think that in order to help 3rd-party apps manage the move towards dropping Python 2 support, we should decouple the deprecation of Py2 shims from other Django deprecations. So, I'm thinking we should have a new warning class, something like "Python2DeprecationWarning"; this would be easy enough to silence for people who want to keep using them -- we could even provide a context-manager based on warnings.catch_warnings() that would specifically silence this warning, so 3rd-parties could silence it on their own uses easily. That's eating the warnings cake while keeping it whole, as far as I can see. Shai.