Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 375
aahnik Avatar asked Nov 18 '25 10:11

aahnik


1 Answers

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

like image 120
aahnik Avatar answered Nov 21 '25 01:11

aahnik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!