Description
Hello!
I've been using the Settable class with the path completer, and Pylance shows an argument type error (reportArgumentType). When I change the code to get rid of the error and run it, I get a TypeError.
Please let me know if I am using the argument incorrectly, if this an issue with Pylance, or if I'm just being a doofus.
Thank you
Environment
- Python 3.12.2
- Visual Studio Code 1.115.0
- Python
ms-python.python 2026.4.0
- Pylance
ms-python.vscode-pylance 2026.2.1
Steps to Reproduce
Source
from cmd2 import Cmd, Settable
class App(Cmd):
def __init__(self):
super().__init__()
self.no_error = None
self.type_error = None
self.add_settable(
Settable(
"no_error",
str,
"completer=self.path_complete",
self,
completer=self.path_complete,
)
)
self.add_settable(
Settable(
"type_error",
str,
"completer=Cmd.path_complete",
self,
completer=Cmd.path_complete,
)
)
if __name__ == "__main__":
App().cmdloop()
The squiggle:
What Pylance says:
When running:
The type_error attribute is correctly reporting available directories when I hit tab, while the no_error attribute gives the TypeError for a parameter mismatch.
Description
Hello!
I've been using the
Settableclass with the path completer, and Pylance shows an argument type error (reportArgumentType). When I change the code to get rid of the error and run it, I get aTypeError.Please let me know if I am using the argument incorrectly, if this an issue with Pylance, or if I'm just being a doofus.
Thank you
Environment
ms-python.python2026.4.0ms-python.vscode-pylance2026.2.1Steps to Reproduce
Source
The squiggle:
What Pylance says:
When running:
The
type_errorattribute is correctly reporting available directories when I hit tab, while theno_errorattribute gives theTypeErrorfor a parameter mismatch.