deprecator提供了一个decorator来轻松地否决旧代码。
deprecator的Python项目详细描述
Author: | Anthony Long |
---|---|
Version: | 0.2 - Initial release. |
什么是贬低者?
deprecator是一个装饰器,它可以帮助您记录文档,并警告用户不要使用它。
用法:
from deprecator import deprecate def bar(): print("hello") @deprecate(bar) def foo(): print("hello")
调用时,foo将打印:
deprecationwarning:foo已弃用;请改用bar。
您好