Challenge 1
Warn callers that the API is deprecated, and attribute the warning to the call site.
import warnings
def old_api():
with warnings.catch_warnings(record=True) as recorded:
warnings.simplefilter("always")
old_api()
print(recorded[0].category.__name__)
Press Ctrl⌘Enter to check your answer