The problem is the order of the lines in the file.
The type of the function inputStr() is recognized correctly
..... means [snip] of the line(s)
def inputStr(
prompt="",
.....):
# type: (str, .....) -> Any
"""Prompts the user to enter .....
"""
For inputCustom() the type recognition is incorrect because the type line is incorrect
def inputCustom(
# type: (Callable, str, .....) -> Any
customValidationFunc,
prompt="",
.....):
"""Prompts the user to enter input. ....."""
it should be AFTER the argument list.
def inputCustom(
customValidationFunc, prompt="", .....):
# type: (Callable, str, .....) -> Any
"""Prompts the user to enter input. ....."""
Do the same for the function inputNum()
You can edit the __init__.py file and move the 2 comment lines to the correct position.
Then VSC will show the type in the tooltip.
I have created an Issue at pyinputplus for it.
Edit:
I have looked at why pylint shows this cryptic error and the problem is that the Python3.8 compiler reports this as a syntax error when you compile with type_comments=True. Pylint first tries to compile with type_comments=True but does not test the Python3.8 exception correct.
I have written a replacement for astroid/builder.py::_parse_string(). The line is not reported as an error anymore. Maybe when they use the rewrite, they will add an error for a misplaced type annotation.