I'm programming in python
I'm making a function in Python using Visual Studio Code but the suggestions don't include string methods like replace()
, lower()
and strip()
.
I don't know what is causing this issue and I tried every setting in Visual Studio Code. Can anyone tell me why it doesn't show the methods while other IDEs do?
CodePudding user response:
You could use text:str
so that pylance knows text is String.
Your original code doesn't define the type of text
. It can be any type. Naturally, pylance can't give advice.