There is a little known tool that I wanted to talk about today. It is called wraps and it’s a part of the functools module. You can use wraps as a decorator to fix docstrings and names of decorated functions. Why does this matter? This sounds like a weird edge case at first, but if you’re writing an API or any code that someone other than yourself will …
Keep reading with a 7-day free trial
Subscribe to The Python Papers to keep reading this post and get 7 days of free access to the full post archives.