When I decorate a python function, VS Code shows the wrapper's help, instead of the function's , when hovered

1.4k Views Asked by At

VS is code is now the most popular code editor and I love it.

When you hover your mouse over a function, it shows you the function signature and help doc string.

When you decorate a function, its help docstring changes to that of the wrapper's. ( to understand what I mean read this↗️ )

In python 3.4+ This is fixed by using functools.wrap as shown here.( Please read ⬅️ that to better understand my problem.) I am not writing because its well explained there.

But when I hover over the function in VS Code, it shows the docstring of the wrapper.

How can I make VS code show the docstring of the original function ?

1

There are 1 best solutions below

0
On BEST ANSWER

VS Code (newer pylance server ) has become smart and it now does the correct thing! by default.