user669132
user669132

Reputation: 199

Comma errors while using vim-syntastic plugin

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

Upvotes: 0

Views: 69

Answers (2)

user669132
user669132

Reputation: 199

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

Upvotes: 0

Helder Sepulveda
Helder Sepulveda

Reputation: 17664

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

Upvotes: 0

Related Questions