| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Currently some language servers cannot parse the type of wrapped functions. _TFunc is bounded to the function.
add one more space to pass static check
| Back | FazBrowse Home | New Git URL |
Currently some language servers cannot parse the type of wrapped functions. _TFunc is bounded to the function.
Context
Decorated function will lose type hint in some Python language servers (e.g Pylance which VSCode will use officially in the future). Language server is working as intended, and if our wrapper does not change arg types, we should add type hint.
See: microsoft/pyright#774 (comment)
Example code:
VSCode with Pylance:

Argument hint:

After this PR:

Argument hint:

Checklist
No new unit test since no function change. Unit test result is the same to before this PR.