Hi Anders,

If correctly understood your concern, it's about usage of stdlib's *Warning 
classes directly
that makes all warnings coming from different libraries indistinguishable.

I think that's not the case, since warnings.filterwarnings allows
to specify custom filter using a regular expression to match module names.
Therefore it's not redundant to subclass *Warning for namespacing alone.

> On Sep 13, 2018, at 11:07 PM, Anders Hovmöller <bo...@killingar.net> wrote:
> 
> 
>> 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

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to