mypy
mypy copied to clipboard
docs: use ParamSpec in "Declaring decorators"
Resolves #12983.
While the documented approach is valid for the common case of a decorator which doesn't change the function type, and as the docs say the cast isn't too bad in such a small function, I suppose ParamSpec would be the best practice for decorators going forward, so we should provide it as a "recipe".
Let's wait for a bit, maybe @srittau or @JelleZijlstra have some feedback?