You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
Inferred return type of a decorated function is incorrect.
(That is the one for the function without the decoration.)
Environment data
Language Server version: 0.5.10.0
OS and version: macOS 10.15
Python version (& distribution if applicable, e.g. Anaconda): Anaconda3 Python 3.7.3
Expected behaviour
The LS infers a correct return type of a decorated function.
Actual behaviour
The LS infers a return type of a decorated function as if the function is not decorated.
Logs
N/A
Code Snippet / Additional lnformation
fromtypingimportAny, Callabledefstringify(f: Callable[..., Any]) ->Callable[..., str]:
defwrapper(*args) ->str:
returnstr(f(*args))
returnwrapper@stringifydefone() ->int:
return1value=one() # inferred type of `value` by the LS is `int`,# but it should be `str`print(type(value))
# <class 'str'>
The text was updated successfully, but these errors were encountered:
True, currently analysis does not look into decorators in order to find out possible return type. Also, Callable is not currently handled. #1115 and #535
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Inferred return type of a decorated function is incorrect.
(That is the one for the function without the decoration.)
Environment data
Expected behaviour
Actual behaviour
Logs
N/A
Code Snippet / Additional lnformation
The text was updated successfully, but these errors were encountered: