Closed vient closed 2 months ago
See this issue for information about why pyright (the static type analysis engine upon which pylance is based) behaves as it does in this case. It's due to the way that functools.cache
and functools.lru_cache
are defined in the typeshed stubs. A change in behavior here would require a modification to the typeshed stubs. There are some tradeoffs for this change, however. Because of this, the maintainers of typeshed have been reluctant to accept a change. If you have an opinion on the matter, I recommend posting in the typeshed thread.
First of all, I am not sure that this is an issue in vscode-python and not in some other part of VSCode but I don't know how to understand which component is responsible - please point me in the right direction.
Consider this example
Pointing to
is_even(2)
call shows a tooltip with function prototype and documentationNow we add
lru_cache
and it still shows that
is_even
is a function but prototype changes to_lru_cache_wrapper[bool]
and doc-string is gonePython 3.12
help()
output iswithout lru_cache and
with it.
So, while it is helpful to see that the function is wrapped in lru_cache, it would also be nice to see proper argument list and documentation.