In this section, we'll take a look at how to associate metadata with functions beyond docstrings, which we discussed in Chapter 4, Basic Best Practices. In the previous section, one of our examples was a decorator that automatically passed all our decorated function arguments through an adapter.
That's pretty cool, but what if we want to handle each parameter differently?
Sure, we could pass a whole bunch of adapters to the wrapper, but it becomes ugly and clumsy as we start dealing with functions that accept more parameters. What we'd really like to do is attach metadata directly to a function's parameters. Fortunately, that's exactly what function annotations are for.