Comma errors while using vim-syntastic plugin

74 Views Asked by At

When saving python files, vim-syntactic starts debugging and raises syntax errors (specifically commas), whether its in a list, dictionary, tuple etc. Here is an image after saving python file.

enter image description here

2

There are 2 best solutions below

0
user669132 On BEST ANSWER

Vim-Syntactic throws syntax errors when you don't add a space after commas.

√ animals = set(['cat', 'dog', 'mouse'])  # no errors
x animals = set(['cat','dog','mouse'])  # errors
2
Helder Sepulveda On

The problem is your code, that is not valid syntax, I guess you are very new to python...

An object is declared using the {}
Here is how an object looks like:

farm_animals = {"sheep":"big", "cow":"huge"}
print(farm_animals)

You can try it out online on some other editor:
http://py3.codeskulptor.org/#user301_UotVM3f1Pw_0.py