mypy icon indicating copy to clipboard operation
mypy copied to clipboard

docs: use ParamSpec in "Declaring decorators"

Open ikonst opened this issue 3 years ago • 1 comments

Resolves #12983.

ikonst avatar Jul 26 '22 00:07 ikonst

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".

ikonst avatar Jul 26 '22 00:07 ikonst

Let's wait for a bit, maybe @srittau or @JelleZijlstra have some feedback?

sobolevn avatar Aug 12 '22 14:08 sobolevn