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)
python 对过时类或方法添加删除线的方法
原文:https://www.cnblogs.com/cfpl/p/12037319.html