Reputation: 81
When creating a user defined function the built-in methods do not pop up as options.
In the main body of the file the methods show up without issue. It's only when you create a function that they do not show up.
def strip_punctuation(astring):
#punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']
astring.replace()
return (astring)
# Main file
my_string = "Word's!"
my_string.replace()
I'd expect the same behavior in VS Code in both a user defined function as well as outside the function.
Upvotes: 1
Views: 68
Reputation: 16080
If you rewrote your code with type annotations you should get what you want:
def strip_punctuation(astring: str) -> str:
astring.replace()
return astring
Upvotes: 1