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)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM