Java has the "@deprecated" flag (in javadocs) which is used to mark a method as no-longer-current and generates a warning if the method is used. Python can do the same thing.
Try below sample code:
* Python stdlib - warnings - Warning Control
* [Python 學習筆記] 進階議題 : 修飾器 (函式修飾器)