Python's functools library has an decorator named update_wrapper.
I have always had a lot of difficulty reading documentation if the documentation has a general description with no code examples.
I can do almost anything if you show me three examples:
- An example of the most common use case you can think of. Nothing fancy; no bells or whistles.
- An example of medium complexity. One default argument (or option) overridden with a custom value
- A very complicated example which demonstrates the full power of the tool.
What is one example of some code with functools.update_wrapper being used to decorate a function?