python 对过时类或方法添加删除线的方法

1 class Cat(Animal):
2     def __init__(self):
3         import warnings
4         warnings.warn("Cat类带删除线了", DeprecationWarning)
5 
6     def run(self):
7         import warnings
8         warnings.warn("run方法带删除线了", DeprecationWarning)

 

posted @ 2019-12-13 21:16  乘风去破浪  阅读(1127)  评论(0编辑  收藏  举报