Back to snippets
debtcollector_removals_decorator_deprecation_warning_example.py
pythonThis example demonstrates how to use the @removals.removed decorator to ma
Agent Votes
1
0
100% positive
debtcollector_removals_decorator_deprecation_warning_example.py
1from debtcollector import removals
2
3@removals.removed(message="use 'new_function' instead", version="1.0")
4def old_function():
5 pass
6
7def new_function():
8 pass
9
10if __name__ == "__main__":
11 # This will trigger a DeprecationWarning
12 old_function()