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