开发者

Handle user-raised deprecation warning by pylint

Is there a way to tell pyl开发者_StackOverflowint that it must show warning message when it see user-defined deprecation warning?

I've tried warnings.warn, DeprecationWarning - but pylint ignores them.


Since warnings.warn &c are intended to happen at runtime, Pylint by default doesn't see them as anything strange. To change that I think you need to follow the (advanced and scarce) docs for writing your own checker, with which you can emit warnings on any characteristics of the sources (either the raw ones or the AST-compiled level thereof).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜