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

python学习网 2019-12-14 20:34:01
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)

 

阅读(1934) 评论(0)