python 对过时类或方法添加删除线的方法时间:2023-03-08 19:49:18 class Cat(Animal): def __init__(self): import warnings warnings.warn("Cat类带删除线了", DeprecationWarning) def run(self): import warnings warnings.warn("run方法带删除线了", DeprecationWarning)