I've noticed that certain variable names in Python get flagged up by Vim in blue highlight, whereas others do not. I'm familiar with the concept of reserved words, per this question, but from looking it up, "str" does not appear to be one of these words.
Despite the highlighting however, it doesn't (seem) to cause any problems. A simple example:
str = "Hello"
sfgfgf = "World"
print(str)
print(sfgfgf)
And here's a screen snip of Vim's highlighting:
In both the variable definition and the print statement, str
is highlighted blue but sfgfgf
is not. Yet this code happily prints "Hello" and "World".
The same is true for "int", and I'm sure that there are other examples (the below code also runs without complaint):
int = 1
intentional_or_no = 5
print(int)
print(intentional_or_no)
So, my question:
- Is there any issue with using words such as "str" and "int" as variable names?
- If not, why does Vim highlight them in blue?