[Python-ideas] Deprecation utilities for the warnings module
Jacco van Dorp
j.van.dorp at deonet.nl
Fri Sep 14 03:19:22 EDT 2018
Op vr 14 sep. 2018 om 08:07 schreef Anders Hovmöller <boxed at killingar.net>:
> > 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 feel there could be solutions. Either module.__getattribute__ (which,
IIRC, was implemented recently), or just using a proxy/wrapper class around
non-Union[class, function] objects. Those are rare, though, in imported
modules. And I don't think this library will see much use without the
subjects being imported first - at least I know I do my refactors on a
per-file basis. And if you can't, you might want to split your files first.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas