0

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

Helder Sepulveda
  • 15,500
  • 4
  • 29
  • 56
user669132
  • 189
  • 1
  • 10

2 Answers2

0

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

Helder Sepulveda
  • 15,500
  • 4
  • 29
  • 56
  • @ HelderSepu WOW. Thanks for catching that. I read somewhere that I can create sets using curly brackets and if the items are separated like a list i.e. commas, then it'll interpret it as a set. Im a fan of vim but ill check codeskulptor out. Thanks again :) – user669132 May 01 '18 at 00:39
  • @plutonium244 Dont forget to +1 ...and mark as the answer if it solves your problem – Helder Sepulveda May 01 '18 at 12:37
0

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
user669132
  • 189
  • 1
  • 10