-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Milestone
Description
Steps to reproduce
Expected behaviour
Hover on referenced function, its actual signature pops up
Actual behaviour
Instead, decorator's signature was prompted, as in screenshot above
Configuration
Operating System: macOS 11.4
Version of Python, python-telegram-bot & dependencies: Python 3.6.9 (pyenv), PTB 13.6
I first reported this to pylance (microsoft/pylance-release#1470), and was pointed out that @log()
's annotation is to blame (microsoft/pylance-release#1470 (comment)):
...
in func: Callable[..., RT]
throws away parameter definition, and should use ParamSpec
instead.
python-telegram-bot/telegram/bot.py
Lines 121 to 123 in 105f1cc
def log( # skipcq: PY-D0003 | |
func: Callable[..., RT], *args: object, **kwargs: object # pylint: disable=W0613 | |
) -> Callable[..., RT]: |
However, ParamSpec
is pretty new (landed in Python 3.10) thus requires typing_extension
package with older Python.