[Python-ideas] Deprecation utilities for the warnings module

Anders Hovmöller boxed at killingar.net
Fri Sep 14 02:07:00 EDT 2018


> I'd like to propose an extension for the warnings module
> to address this problem.

I like all of that. The only issue I have with it is that the warnings module is designed to namespace depredations so you can turn them on per library and this code doesn’t seem to handle that. We really want to avoid libraries using these convenience functions instead of creating their own warning that can be properly filtered. 

I’m not sure what the solution to this would be. Maybe just accessing <yourmodule>.DeprecationWarning dynamically? Seems a bit magical though. 

/ Anders


More information about the Python-ideas mailing list